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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

102 views 0 5
Read article

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