Info |
---|
|
This routine is available starting with katl-commons 2.5.19 / 2.6.11. Table plus |
---|
applyColStyleToCell | true |
---|
heading | 0 |
---|
columnTypes | s,s,s,s |
---|
multiple | false |
---|
columnAttributes | style="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold, |
---|
enableSorting | false |
---|
|
Syntax | admCreateCustomField(fieldName, description, fieldType, fieldSearcher, projects, issueTypes) | Package | | Alias | | Pkg Usage | | |
Description
Excerpt |
---|
|
Creates a new custom field, offering support also for setting its context and searcher. |
Parameters
...
Parameter name
...
Type
...
Required
...
Description
...
Parameters (Cloud)
Creates a new custom field, offering support also for setting its context and searcher.
Parameters
Table plus |
---|
applyColStyleToCell | true |
---|
columnTypes | s,s,s,s |
---|
heading | 0 |
---|
multiple | false |
---|
enableSorting | false |
---|
|
Parameter name | Type | Required | Description |
---|
fieldName | |
...
...
Yes | Custom field name. | description |
|
...
...
Yes | Custom field description (can be blank). | fieldType |
|
...
...
Yes | Custom field type (either key |
|
...
...
...
Yes | Custom field searcher (either key |
|
...
or name). If blank, the default custom field searcher for the given type will be considered. | projects |
|
...
...
Yes | Projects context (project keys). If empty, global issue context will be considered. | issueTypes |
|
...
...
Yes | Issue types context (either names or ids). If empty, all issue types will be considered. |
|
Return
...
Type
stringString
Returns the string id (customfield_xxxxx) of the newly created custom field.
...
Examples
Example 1
...
Creating a single line text field with default searcher (Free Text Searcher) and global context:
Code Block |
---|
admCreateCustomField("Test Field", "test description", "Text Field (single line)", "", {}, {});
|
Example
...
2
Creating a multi-line text field with blank description, specified searcher name (Free Text Searcher) and specified project and issue types context:
Code Block |
---|
admCreateCustomField("Test Field", "", "Text Field (multi-line)", "Free Text Searcher", {"DEMO", "TEST"}, {"Bug", "Improvement"});
|
Example
...
3
Creating a date picker field with blank description, specified searcher key, and specified issue types ids context:
Code Block |
---|
admCreateCustomField("Test Field", "", "Date Picker", "com.atlassian.jira.plugin.system.customfieldtypes:daterange", {}, {1, 2, 3});
|
Example 4 (cloud)
Creating a cascading select field with no specified searcher key (the default will be used) and global context:
Code Block |
---|
admCreateCustomField("A cascadingselect", "cascadingselect", "com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect", "", {}, {}); |
Example 5 (cloud)
Creating a simple text field with a specified searcher key and global context:
Code Block |
---|
admCreateCustomField("Test text Field", "single line text field used to test the admin create CF", "com.atlassian.jira.plugin.system.customfieldtypes:textfield", "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", {}, {}); |
Example 6 (cloud)
Creating a cascading select field with no specified searcher key (the default will be used) and specific project and issue type context:
Code Block |
---|
admCreateCustomField("A TJ cascadingselect", "cascadingselect", "com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect", "", {"TJ"}, {"Task"}); |
Note |
---|
If the provided custom field searcher key or name is wrong, it will be ignored and the custom field will be created with no searcher configured. |
See also
Filter by label (Content by label) |
---|
showLabels | false |
---|
max | 25 |
---|
showSpace | false |
---|
cql | label = "jiracustomfield_fieldadmin_routine" and space = currentSpace ( ) |
---|
labels | jiraarray_field_routineroutines |
---|
|