Script Runner addon causing issues not to reindex

Steven Lam
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.
August 21, 2013

Hello,

I have been having issues with the script runner for a couple months now. I am adding a post-function script to a workflow transition and when progressing this workflow transition the issue will jump to the next status, however, filters, subscriptions and queries that display this issue will continue to show the old status.

Things to note:

- I am using this script runner on completely custom workflows

- This problem is NOT happening on every workflow transition that executes the script runner

- I have tried moving the order of this execution of the post script to AFTER the issue is reindexed with the database, however, that has proved to be unsuccessful.

- Atlassian support has recommended disabling this addon which seemed to solve the issue

- The script being run is a simple commenter that adds a comment on behalf of the user. The code was actually taken from a sample provided in Script Runner documentation pages.

Any help would be appreciated.

Regards,

Steven

4 answers

1 accepted

1 vote
Answer accepted
Vincent Thoulé
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.
August 21, 2013

Hi Steven,

If you are using JIRA 5.1 to 5.2.9, it is possible that you are experiencing a side effect of the new way that IndexManager works. For these versions, Issues are no more indexed by the Index Post-Function, but at the end of the transaction initiated for the Workflow transition.

It means that your scripts are executed with an issue not yet indexed; or changes done by these script are indexed (if indexation initiated in the script) before the indexation initiated by the Index Post-Function.

The issue is already known : JRA-31775.

It may cause error with Script Runner, but also with Auto-Transition.

See details and workaround here.

Vincent

1 vote
Vincent Thoulé
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.
August 22, 2013

Since 6.0, the issue is normaly fixed related multiple indexation of the same issue. The indexation doen in the correct order, but always at the end of the Transition Transaction.

If your script makes update on different issues based on value modified by a Post-Function executed in the same transition before your script, you may experience inconsistencies.

For the moment, I always use my Force Indexation post-function.

I did not yet check with latest 6.0.x releases.

V.

0 votes
Steven Lam
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.
August 22, 2013

Hi Vincent,

I was on 5.2.5 but recently upgraded.

Do you happen to know if this issue still exists in version 6.0+?

0 votes
JamieA
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.
August 21, 2013

Versions? Any errors in the log?

Provided samples can be out of date.

Suggest an answer

Log in or Sign up to answer