I'm writing a Groovy post function for a workflow transition in JIRA. This script sets the value of a multi-user custom field (ArrayList). After calling 'setCustomFieldValue()', I call 'store()' to store the issue. But it doesn't store the changes. I checked the database as well.
However, if I call 'getCustomFieldValue()' after 'setCustomFieldValue()', I can print the changes into log. Thaty means 'setCustomFieldValue()' method has worked properly.
In another script we have, it sets security level field and calls 'store()' method. That one works perfectly.
Is there any other method provided to store custom field values?
Community moderators have prevented the ability to post new answers.
You could use issueManager.updateIssue() for this. issue.store() only works for direct members of the issue object itself and custom fields doesn't belong to this.
Thank you.
I guess this will update all the modified fields, isn't it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, all fields.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Found the answer here: http://stackoverflow.com/questions/8251892/how-do-i-save-a-value-into-a-custom-field-in-jira-programmatically
Following is an 'easy' way I'm using.
DefaultIssueChangeHolder issueChangeHolder = new DefaultIssueChangeHolder(); cf_object.updateValue(null, issue, new ModifiedValue(null, issue.getCustomFieldValue(cf_object)), issueChangeHolder);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.