admGetCustomFieldOptions

admGetCustomFieldOptions

Syntax

admGetCustomFieldOptions(fieldName[, projectIssueTypesNames[, filterDisabled]])

Package

adm

Alias

 

Pkg Usage

getCFOptions(fieldName[, projectIssueTypesNames[, filterDisabled]])

Description

Retrieves the JCustomFieldOption array of a custom field. If projectIssueTypesNames is empty or is not provided, the global context is going to be used. If the filterDisabled parameter is used set to true, all disabled options are excluded from the result. In case of cascade selects, the optionId represents the id of the parent option. This function only handles custom fields of the following types: single select, multi select, radio buttons, checkboxes and cascading selects.

Parameters

Parameter name

Type

Required

Description

Parameter name

Type

Required

Description

fieldName

String

Yes

Name of custom field.

projectIssueTypesNames

JProjectIssueTypes []

No

An array of JProjectIssueTypes structures, representing project keys/issue types mappings. (The contexts from which to get the options)

filterDisabled

Boolean

No

Filter for disabled options.

Return Type

JCustomFieldOption[]

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

Example

Example

Get the options of 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[] customFieldOptions = admGetCustomFieldOptions("checkbox", 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("_________________________________________________");

Possible result as a string:

---option 1--- id = 10044 optionId = value = option1 disabled = false ---option 2--- id = 10045 optionId = value = option2 disabled = true

See also

Peacock

Need support? Create a request with our support team.

Copyright © 2005 - 2025 Appfire | All rights reserved.