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

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 vote
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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

546 views 1 18
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