...
Info | ||
---|---|---|
| ||
This routine is available since starting with katl-commons 2.5.19 / 2.6.11. |
Syntax
...
admCreateCustomField(fieldName, description, fieldType, fieldSearcher, projects, issueTypes)
Description
...
Excerpt |
---|
Creates a new custom field, offering support also for setting its context and searcher. |
Parameters
...
Parameter name | Type | Required | Description |
---|---|---|---|
fieldName | string | yes | The custom field name |
description | string | yes | The custom field description (can be blank) |
fieldType | string | yes | The custom field type (either key or name) |
fieldSearcher | string | yes | The custom field searcher (either key or name). If blank, the default custom field searcher for the given type will be considered. |
projects | string[] | yes | The projects context (project keys). If empty, global issue context will be considered. |
issueTypes | string[] | yes | The issue types context (either names or ids). If empty, all issue types will be considered. |
Return type
...
string
Returns the string id (customfield_xxxxx) of the newly created custom field.
Example
...
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:
...
Info |
---|
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) | ||||||||
---|---|---|---|---|---|---|---|---|
|