Using script runner, I want to use the java API to check if jira is currently being indexed and if so, i want to pause it temporarily. I know how to use the indexmanager class to start a new reindex process but I want to check if an index has begun outside of a given script.
Specifically, i have a scripted field that makes a jql search. The search throws an error during indexing. So i want to check if jira is being reindexed and pause it before the search.