$customHeader
Skip to end of banner
Go to start of banner

admUpdateCustomFieldOptions

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Description

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.

Parameters

Return Type

Boolean (true/false)

Returns 'true' if the options were successfully updated and 'false' otherwise. If returned 'false' check the log for a detailed reason on why it failed.

Examples

Example 1 - Updating a Cascading Select Custom Field

For Example 1.1 and Example 1.2 we will consider as a starting point, the following already existing options of the custom field:

Parent1
 Child1
 Child2
Parent2
 Child4

and as an input file, "updateoptions.txt", that has the following contents:

 

Example 1.1. - Updating a Cascading Select Custom Field - Delete missing input options, rename existing input options

Option "Parent2 - Child4" is going to be removed, because the actionForOldFieldValues parameter is "DELETE".
Option "Parent1 - Child1" will be renamed to "PARENT1 - CHILD1" because the parameter updateExistingOptionsValues is set to true.
The new option "PARENT1 - Child3" is added at the end of the existing options because the parameter reorder was set to false.

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

The resulted field options will now be:

 

Example 1 - Updating a Cascading Select Custom Field

For Example 1.1 and Example 1.2 we will consider as a starting point, the following already existing options of the custom field:

Parent1
 Child1
 Child2
Parent2
 Child4

and as an input file, "updateoptions.txt", that has the following contents:

 
Option 1
 Child option 1
 Child option 2
Option 2

 Child option 3
 Child option 4

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

  • No labels