Versions Compared

Key

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

Button handy
blanktrue
color#0052CC
nameSend Feedback
linkhttps://docs.google.com/forms/d/e/1FAIpQLScmToBe3vynAlb5fdKwCGxYqnTbDc66sIBgeecG2BuFDuHc7g/viewform?entry.2002826954=admGetCustomFieldOptions+-+15489447
widthauto

Table plus
applyColStyleToCelltrue
heading0
columnTypess,s,s,s
multiplefalse
columnAttributesstyle="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold,
enableSortingfalse

Syntax

admGetCustomFieldOptions(fieldName, projectKeys, issueTypes [, filterDisabled])

Package

adm

Alias

Pkg Usage

getCFOptions(fieldName, projectKeys, issueTypes [, filterDisabled])

Description

Excerpt
hiddentrue

Retrieves the option list of a custom field for the specified context (projects and issue types).

Retrieves the option list of a custom field for the specified context (projects and issue types).

All parameters are required. However, but if the project keys and issue types arrays are empty, the global context is going to be usedused. If the filterDisabled parameter is used set to true, all disabled options are excluded from the result.

Each option will reside is on a separate line. In case of cascade cascading selects, the child options will be are prefixed with by a space character.

The new lineseparator is system-dependent (where the system can be either Windows, Mac or Linux). The line separator can be either '\n', '\r' or '\r\n'. This routine function only handles custom fields of the following custom field types: single select, multi select, radio buttons, checkboxes check boxes and cascading selects.

Parameters

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

Parameter name

Type

Required

Description

fieldName

String

Yes

Name of custom field.

projectKeys

StringĀ []

No

Project keys.

issueTypes

StringĀ []

No

Issue types.

filterDisabled

Boolean

No

Filter for disabled options.

Return Type

String

Returns a string representing the options of the specified custom field.

...

Example 1

Get the options of the "CF_CASCADE " custom field, using the global context.

...

Possible result as a string:

Code Block
<ac:structured-macro ac:name="code" ac:schema-version="1"><ac:plain-text-body>Parent Parent option 1
 Child option 1
 Child option 2
Parent option 2
 Child option 1
 Child option 2</ac:plain-text-body></ac:structured-macro>2

Example 2

Get the options of the "CF_SELECT " custom field, using the context for projects "PRJ1" and "PRJ2" and issue types "Bug" and "Task".

Code Block
admGetCustomFieldOptions("CF_SELECT", {"PRJ1", "PRJ2"}, {"Bug", "Task"});

Possible result as a string:

<ac:structured-macro ac:name="code" ac:schema-version="1"><ac:plain-text-body>Option
Code Block
Option 1
Option 2
Option 3

Example 3

Get the options of the CF_SELECT custom field, using the context for projects PRJ1 and PRJ2 and issue types Bug and Task.

Code Block
admGetCustomFieldOptions("CF_SELECT", {"PRJ1", "PRJ2"}, {"Bug", "Task"}, true);

Assuming we have three options and Option 3 is disabled, the result should be:

Code Block
Option 1
Option 2
Option 3</ac:plain-text-body></ac:structured-macro>

See also

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