Groovy script doesn't work on JIRA 6.0.8

Sergey L October 21, 2013

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
Answer accepted
Henning Tietgens
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.
October 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
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.
October 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).

Sergey L October 21, 2013

Henning Tietgens, thanks!

0 votes
Henning Tietgens
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.
October 21, 2013

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

Henning Tietgens
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.
October 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.

Sergey L October 21, 2013

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