setFieldValue(String <field_name>or<field_Id>, Object value)
method sets the value of a system or custom field of the Issue object where,
<field_name
> is the name of the field as displayed in the Field configuration<field_id>
is the ID of the field as shown in Accessing the JIRA Jira Standard fields of an issue document. In the case of a custom field, it has the formcustomfield_xxxxx
, wherexxxxx
is the custom field numerical ID, as seen in the URL when viewing or editing the field.Object value
, is the value which is same as what is expected to be returned as the result of a Groovy expression
...
- Groovy script tester admin page: When you call this method on any Issue object passing the
<field_name>
or<field_id>
andObject value
, inGroovy script
of the Groovy script tester page and test it, the specified field gets set to the specified value. This is useful when you want to just set a field value without the need to trigger any transition or add a post-function.- Example: Set the Fix Version/s of the parent to the child
- Go to the JMWE administration pages
- Click on Groovy script tester
Write the following script in
Groovy script
Code Block language groovy linenumbers true parentIssue.setFieldValue("Fix Version/s",issue.get("fixVersions"))
Click on
Test Groovy script
from the toolbar- Select the child
Issue key
on whose parent you wish to set the value - Click on
Test
- Go to the parent issue
- Example: Set the Fix Version/s of the parent to the child
...