Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to set value of a custom field in jira using groovy script?

sandeep vb
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 12, 2015

I need to copy value of a custom field into another customfield.
I tried this.

CustomField cf1 = cfManager.getCustomFieldObject(11419)
CustomField cf2 = cfManager.getCustomFieldObject(10204)
issue.setCustomFieldValue(cf2,issue.getCustomFieldValue(cf1))
 
But setCustomFieldValue function makes changes only in the issue object here but changes are not reflected in database. How can I achieve this?

 

1 answer

1 accepted

4 votes
Answer accepted
Andrey Kuzmin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 12, 2015

Hello, @sandeep vb.

Try solution that I suggested here.

sandeep vb
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 12, 2015

Thank you very much Andrey Kuzmin, I tried what you had mentioned. I could make changes in the user database successfully.

Suggest an answer

Log in or Sign up to answer