Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table plus
applyColStyleToCelltrue
heading0
columnTypess,s,s,s
multiplefalse
columnAttributesstyle="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold,
enableSortingfalse

Syntax

admUpdateCustomFieldOptions(fieldName, pathToFile, charset, actionForOldFieldValues, actionForExistingFieldValues, projectKeys, issueTypes, useDefaultScheme, reorder, updateExistingOptionsValues, applyActionsOnParentOptions)

Package

adm

Alias

Pkg Usage

updateCFOptions(fieldName, pathToFile, charset, actionForOldFieldValues, actionForExistingFieldValues, projectKeys, issueTypes, useDefaultScheme, reorder, updateExistingOptionsValues, applyActionsOnParentOptions)

Description

Excerpt
hiddentrue

Updates custom field options for the specified context. If the context does not exist, it will be created.

Updates custom field options for the specified context. If the context does not exist, it will be created. If the project keys and issue types are not specified (empty arrays), the option will be added to the global context. This routine only handles custom fields of the following types: single select, multi select, radio buttons, checkboxes and cascading selects.

Note

Important changes starting with SIL Engine v 5.8.0.4

It was discovered that, in some cases, the routine was introducing some inconsistencies regarding the field configuration’s applicable project/issue types and their options. Therefore, some updates were made to deal with this issue.

The custom field options update is now performed only when there is a 100% match between the provided Project Keys/Issue Types pair and an existing context. If there isn’t such a match, a check is made to see if the creation of a new context is possible (without interfering with the existing contexts).

If the check passes, a new context is created and the updates are performed on this newly created context.

If not, the routine simply returns ‘false’ and no updates are performed.

As a result of these changes, the ‘useDefaultScheme’ parameter was removed because it became obsolete.

Parameters

Table plus
applyColStyleToCelltrue
columnTypess,s,s,s
heading0
multiplefalse
enableSortingfalse

Parameter name

Type

Required

Description

fieldName

String

Yes

Name of custom field.

pathToFile

String

No

The path to a file to read options from.

If this parameter is empty, an empty list of options will be considered.

Note
iconfalse

The file should contain one custom field option on a separate line.


Note
iconfalse

To handle cascading select custom fields children options, prefix them with a space or a tab and they will be considered as children of the closest option from above that isn't prefixed with a space or tab.

charset

String

No

The character set to use when reading from file. If this parameter is empty, then the default system charset will be used.

actionForOldFieldValues

String

No

The action to take for the field values (options) that are present in the current field options but are not present in the input options. Possible values: "NONE", "DISABLE", "ENABLE", "DELETE". If this parameter is empty, the value "NONE" will be used.

actionForExistingFieldValues

String

No

The action to take for the field values (options) that are present in the current field options and are also present in the input options. Possible values: "NONE", "DISABLE", "ENABLE", "DELETE". If this parameter is empty, the value "NONE" will be used.

projectKeys

String []

No

Project keys.

issueTypes

String []

No

Issue types.

useDefaultScheme

Boolean (true/false)

Yes

Specify if you want to use the default configuration scheme (or context) of this custom field.

reorder

Boolean (true/false)

Yes

Specify if you want to reorder the options as they are given in the input file.

updateExistingOptionsValues

Boolean (true/false)

Yes

Specify if you want to update the existing options with the values provided in the input file. This option is needed because Jira considers for example that the option "ABC" is the same as "abc". This option allows you to rename the options.

applyActionsOnParentOptions

Boolean (true/false)

Yes

Specify if you want the actionForOldFieldValues and actionForExistingFieldValues to also be applied to parent options, or just child options.

Note

If this parameter is false and the custom field's type is not cascading select, then the actions will not apply (since only the cascading select custom field can have children displayed in the UI).

Return Type

Boolean (true/false)

...

Code Block
admUpdateCustomFieldOptions("CF _CASCADE", "updateoptions .txt", " ", "DELETE", "NONE", {}, {}, false, false, true, false);

The resulted field options will now be:

...

Updating custom fields with types different than cascading select, works exactly the same, except the fact that the applyActionsOnParentOptions parameter should always be set to true.

See also

Filter by label (Content by label)
showLabelsfalse
max25
showSpacefalse
cqllabel = "customfield_admin_routine" and space = currentSpace ( )
labelsarray_routines