Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Script to perform auto re-indexing on particular issue

nallu October 9, 2018

I have created a 'Script Field' and have written a groovy script which will calculate some data and populate the output in the script field.

It works fine and calculated data displaying in the field without any issues.

but, Issue doesn't get filtered when i search for an issue in Issue Navigator.

Here is the JQL, I used,

issueType = 'Story' AND Script_Field_Test = "Sprint-8"

 

Issue:  It doesn't return the issue which has Script_Field_Test as 'Sprint-8'.

Root Cause: This is because 'Re-Index' not yet performed. 

Workaround: Triggered 'Re-Indexing' manually for all the issues in 'System -> Indexing'. after indexing is done, issue getting listed in issue navigator result. This process takes long time. 

 

Question: Is there a way to include a 'line of groovy code' or an 'API' at the end of the script field's script to do a auto indexing.  

1 answer

0 votes
Nic Brough -Adaptavist-
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 9, 2018

Absolutely not.

If you put "reindex issue" on the end of a scripted field script, you will create an infinite loop and crash your Jira system.

It's not quite as simple as this, but you can imagine that your script is run every time an issue is re-indexed.  Which means an index call would create an index call, which would create an index call, which would create an index call, which would create an index call .....

If your new field applies to existing data, then there's no choice but to run a re-index to get it calculated.  If it's only for new or issues being updated, that's ok because create and edit do the indexing.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events