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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.