Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,294,220
Community Members
 
Community Events
165
Community Groups

How can I get a reference to the current indexing process?

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.

1 answer

0 votes
Nir Haimov Community Leader Jun 17, 2022

That was my first thought but that only allows me to create a new indexer and start indexing.  I dont see how to grab the current indexing process.

Nir Haimov Community Leader Jun 17, 2022

There must be JAVA API for this, just need to keep searching until you find it.

or, you can try to use this REST API:

https://docs.atlassian.com/software/jira/docs/api/REST/8.14.1/#api/2/reindex

The rest api allows me to query the currently running index but still no way to stop or pause

Nir Haimov Community Leader Jun 18, 2022

This is required a lot of digging and tests.

But basically, Reindex is a task, so you can use this JAVA API:

https://docs.atlassian.com/software/jira/docs/api/7.2.2/com/atlassian/jira/task/TaskManager.html

to search over all tasks and if there is a "reindex" running, and if yes then cancel it.

However, I think it's not a best practive to stop reindex process, specially not on regular basis, but it's your call.

I would wait for the reindex to stop and than continue what ever you want to do.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.13
TAGS
Community showcase
Published in Jira Software

Upcoming changes to epic fields in company-managed projects

👋 Hi there Jira Community! A few months ago we shared with you plans around renaming epics in your company-managed projects. As part of these changes, we highlighted upcoming changes to epics on...

14,175 views 34 44
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you