lfSet

Description

Sets the field with the given values.

Parameters

Return Type

None

Examples

Example 1

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

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.

lfSet("components" , {"comp1", "comp2"});

Example 2

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".

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":

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

There are certain fields, from the list provided in Fields and graphic elements supported by Live Fields, that you can’t set the value for:

  • Labels, on Edit, Transition, Create screens

  • Estimate (remaining estimate), on Transition screens

  • Votes

  • Watchers

On the view screen, if you want to edit a field the last value saved for that field will be displayed.

See also