Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info
titleAvailability

This routine is available starting with SIL Engine™ 4.6.3.

Syntax

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

...

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

...

Code Block
PARENT1
 Child3
 Child2
 CHILD1
Parent2
 Child5
Parent3
 NewChild


Example 1.1. - Updating a Cascading Select Custom Field -

...

Delete missing input

...

options, rename existing input

...

options


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

...

Code Block
PARENT1
 CHILD1
 Child2
 Child3
Parent2
 Child5
Parent3
 NewChild

Option "Parent2 - Child4" is going to be removed, because the actionForOldFieldValues parameter is "DELETE".

...

The new option "PARENT1 - Child3" is added at the end of the existing options because the parameter reorder was set to false.


Example 1.2. - Updating a Cascading Select Custom Field - Disable existing options and add the others 


Code Block
admUpdateCustomFieldOptions("CF_CASCADE", "updateoptions.txt", "", "NONE", "DISABLE", {}, {}, false, false, false, true);

The resulted field options will now be:

Code Block
PARENT1
 CHILD1
 Child2
 Child3
Parent2
 Child5

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.



Example 2

Code Block
admAddCustomFieldOption("New Option", "Select List", "TEST", "Bug");

...