If you have upgraded Jira to version 8.10 or above you may see an error like this when re-indexing with ScriptRunner installed:
This error will not show for everyone who upgrades. The problem will only show for users who have ended up with multiple issueFunction fields as a result of past bugs. This is a field added by ScriptRunner for JQL functions and if there are duplicates, they will not show on the custom fields admin area.
To see if there are multiple versions of this indexer field added you can run this script in the Script console:
Example problem output:
If the script returns a "Searcher" count higher than 1 (as shown above) then you have multiple issueFunction fields added to your server. The issueFunction field should only be added once (issueFunction is a field added by scriptrunner to allow JQL functions to work). This has not caused any problems up until Jira 8.9 but a change in the implementation of how field indexers are tracked in Jira 8.10 means that Jira will now register indexers for each issueFunction field. This is what causes the indexing problem with the sr_num_atch index field being added multiple times.
Please take a backup of your Jira Server before running the next script. The script deletes the additional IssueFunction fields found on your Jira instance
To fix it please run the following script in script console:
After running this script, and switching to the log tab of the script console you should see the following on the last line:
Successfully removed n custom field(s)
If that's the case then you should perform a full reindex at a time convenient for you. Please let us know afterwards if the issue was fixed and you were able to successfully reindex without seeing the errors in the log mentioning sr_num_atch like when indexing before.