Groovy script doesn't work on JIRA 6.0.8

Hi all!

Simple groovy script on "Create Issue" with one line code doesn't work.

issue.description += "Test from Groovy"

OR

issue.summary += "Test from Groovy"

Log file is empty.

Any ideas why?

Thanks,

Sergey

2 answers

1 accepted

Accepted Answer
1 vote
Henning Tietgens Community Champion Oct 21, 2013

If the changes should be done after the issue is created you have to add a

issue.store()

after changing the summary. Additionally you have to update the index via the IssueIndexManager.reIndex() method.

Henning Tietgens Community Champion Oct 21, 2013

Maybe you could try without a reindex if you place the post function before the reindex and you are sure you're using the original issue object (like you do in your simple script in you question).

Henning Tietgens, thanks!

0 votes
Henning Tietgens Community Champion Oct 21, 2013

Try move the postfunction to the first position of post functions.

Henning Tietgens Community Champion Oct 21, 2013

Because "Create the issue originally" creates and saves the issue to the database and the changes to the issue object should take place before this function.

Henning Tietgens, it's necessary to update description after issue creation. Is there any way to update issue's description after originally issue is created?

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

20,833 views 2 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you