Info | ||
---|---|---|
| ||
This routine is available starting with
|
Syntax
lfSet(field, value, [triggerChange]);
...
Excerpt |
---|
Sets the field with the given values. |
Note Note that this sets the value on the screen only. It does not set the value on the issue because setting it on the issue requires direct access to the field.
...
Parameter | Type | Required | Description |
---|---|---|---|
field | String | Yes | The field to set the value for. |
value | String | Yes | The value to set. It can be a string value or an array with string values. |
triggerChange | Boolean | No | If set to "true", it triggers the change event when lfSet is used on a field. Available since starting with v. 2.5.6 for Jira 5.x and v. 2.6.1 for Jira 6.x. |
...
The following code example sets the standard priority field as Major"Major" value for the standard Priority field.
Code Block |
---|
lfSet("priority", "Major"); // where field = "priority" and value = "Major" |
Warning | ||
---|---|---|
| ||
The value will not be saved in the database. To save value in the database you should do something like: priority = "Major"; // this saves the value into the database. However, make sure that you're not on the create screen. |
You For fields that can set accept multiple values to a field that can have , you can set multiple values as well. For example, you can set the components field to "comp1", "comp2".
Code Block |
---|
lfSet("components" , {"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. |
If you try to set , for example, 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".
...
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 |
---|
lfSet("customfield_10000", "updated val", true); |
Info | ||
---|---|---|
| ||
There are some certain fields, from the list provided in Fields and graphic elements supported by Live Fields, that you can’t set the value for:
On the view screen, when if you want to edit a field the last value saved for that field will be displayed. |
...
Filter by label (Content by label) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|