admCreateCustomField

Syntax

admCreateCustomField(fieldName, description, fieldType, fieldSearcher, projects, issueTypes)

Description

Creates a new custom field, offering support also for setting its context and searcher.

Parameters

Parameter name

Type

Required

Description

fieldNamestringyesCustom field name.
descriptionstringyesCustom field description (can be blank).
fieldTypestringyesCustom field type (either key or name).
fieldSearcherstringyesCustom field searcher (either key or name). If blank, the default custom field searcher for the given type will be considered.
projectsstring[]yesProjects context (project keys). If empty, global issue context will be considered.
issueTypesstring[]yesIssue types context (either names or ids). If empty, all issue types will be considered.

Parameters (Cloud)

Parameter name

Type

Required

Description

fieldNamestringyesCustom field name.
descriptionstringyesCustom field description (can be blank).
fieldTypestringyesCustom field type (key only).
fieldSearcherstringyesCustom field searcher (key only). If blank, the default custom field searcher for the given type will be considered.
projectsstring[]yesProjects context (project keys). If empty, global issue context will be considered.
issueTypesstring[]yesIssue 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 (won't work on cloud)

Creating a single line text field with default searcher (Free Text Searcher) and global context:

Example 2 (won't work on cloud)

Creating a multi-line text field with blank description, specified searcher name (Free Text Searcher) and specified project and issue types context:

Example 3 (won't work on cloud)

Creating a date picker field with blank description, specified searcher key, and specified issue types ids context:

Example 4 (cloud)

Creating a cascading select field with no specified searcher key (the default will be used) and global context:

Example 5 (cloud)

Creating a simple text field with a specified searcher key and global context:

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:

See also