Versions Compared

Key

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

The use of this routine requires the Power Scripts for Jira add-on be installed and licensed.

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

Syntax

lfSet(field, value, [triggerChange])

Package

Alias

Pkg Usage

...

The following code example sets the "Major" value for the standard Priority field.

Code Block
languagejs
lfSet("priority", "Major"); // where field = "priority" and value = "Major"

For fields that can accept multiple values, you can set multiple values as well. For example, you can set the components field to "comp1", "comp2". Note: You can't set a field if the values are not available for the given field. For example, in order to set the components field to "comp1", "comp2", you have to make sure that "comp1" and "comp2" are valid components for that issue.

Code Block
languagejs
lfSet("components" , {"comp1", "comp2"});

...

If you try to set an issue type field using an array like the code below, lfSet will take into account only the first value from the array. So, this will set the issue type to "Task".

Code Block
languagejs
lfSet("issueType", {"Task", "Bug"});

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

Code Block
languagejs
lfSet("customfield_10000", "updated val", true);

Note

You can�t can?t set fields that are uneditable. For example, on the issue view screen you can�t can?t set status or resolution fields.

...