admAddCustomFieldOptions

Description

Adds new custom field options (JCustomFieldOption[]) to options list for the specified context. If the context does not exist, it will NOT be created. This function only handles custom fields of the following types: single select, multi select, radio buttons and checkboxes.

Parameters

Return Type

JCustomFieldOption[]

Returns an array of JCustomFieldOption structures representing the options added to the specified custom field.

Example

Example

Adding an option to the checkbox custom field, using the context for project with key TP and issue types Bug and Task.

JProjectIssueTypes[] projectIssueTypesNames; JProjectIssueTypes map; map.projectKey = "TP"; map.issueTypesNames = {"Task", "Bug"}; projectIssueTypesNames = arrayAddElement(projectIssueTypesNames, map); JCustomFieldOption[] optionsToBeAdded; JCustomFieldOption option; option.value = "added from SIL"; optionsToBeAdded = arrayAddElement(optionsToBeAdded, option); JCustomFieldOption[] customFieldOptions = admAddCustomFieldOptions("checkbox", optionsToBeAdded, projectIssueTypesNames); int indexCC = 1; for(JCustomFieldOption option in customFieldOptions) { runnerLog("---option " + indexCC + "---"); runnerLog("id = " + option.id); runnerLog("optionId = " + option.optionId); runnerLog("value = " + option.value); runnerLog("disabled = " + option.disabled); indexCC = indexCC + 1; } runnerLog("_________________________________________________");

The result will contain the options added, now with ID's.

See also

Filter by label

There are no items with the selected labels at this time.