Skip to end of banner
Go to start of banner

lfRestrictSelectOptions

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 3 Next »

Availability

This routine is available starting with

  • Power Scripts 2.5.2
  • katl-commons 2.5.3

Syntax

lfRestrictSelectOptions(field, options, [triggerChange]);

Description

Restricts the list of given options from the options of the field.

Parameters

ParameterTypeRequiredDescription
fieldStringYesThe field to restrict options for.
options

String

YesThe list of options to restrict.
triggerChangeBooleanNoIf set to true, triggers the change event on the field when routine is used. Available since v. 2.5.6 for Jira 5.x and v. 2.6.1 for Jira 6.x.

Example

The following code example restricts Major and Minor from the options of the priority standard field.

lfRestrictSelectOptions("priority", {"Major", "Minor"}); //where field = "priority" and options = "Major" and "Minor"

If you want to trigger the change event on the field when using lfRestrictSelectOptions, you can use the optional triggerChange parameter set to true:

lfRestrictSelectOptions("customfield_10000", {"option1", "option2"}, true); 
//where field = "customfield_10000" of type select list, options = "option1" and "option2" and triggerChange = true

See also

  • No labels