How to know background or locked is running in JIRA?

I am developing a plugin. In that I want to know if JIRA is running background or Locked indexing through JAVA code. Is there any way to do this? Is there any API for this?

I have been stuck at this since 2 days. Your help is much much appreciated.

1 answer

0 votes

It's a bit complex, there's no direct call for it.

Could you explain what your plugin is doing?  In general, you don't usually need to know what indexing is running (if any), and there are probably more useful questions you can ask the system.

I have servers issue and software issue. Each software is having servers associated to it. So on updation of software, I want to reindex its associated servers. For eg. If a software has 5000 servers, so I need to index 5000 issues. So I created a schedular which will run daily. But if my reindexing is already running, and I updated a software, So in that case I want to add it to schedular.  For that purpose I need to check if the indexing is already running or not.

I have servers issue and software issue. Each software is having servers associated to it. So on updation of software, I want to reindex its associated servers. For eg. If a software has 5000 servers, so I need to index 5000 issues. So I created a schedular which will run daily. But if my reindexing is already running, and I updated a software, So in that case I want to add it to schedular.  For that purpose I need to check if the indexing is already running or not.

I don't understand this.  What is the "software" here?  Is each one a JIRA issue?  Or some service living on a server somewhere?

The reason I'm confused here is that if both servers and software are issues, then you don't need to re-index them at all - your service is re-doing things that are already done.

Server and Software is each a JIRA issue. We are customizing it as per our need.

Ok that's good and clear now, thank you. 

Issues are re-indexed automatically whenever they are changed.  So you don't need to do it again - you don't need to use your service at all.  Even if you did, whether indexing is running or not is totally irrelevant - if it's not running, great, if a background or project one is running it, your service will repeat the action before or after so it doesn't matter, and if it's a locking re-index, your service won't be executed.

Ok, Thanks Nic. As I said already, Suppose there is a software "Software 1" "and Software 2".

"Software 1"  having 5000 servers (Server 1, Server 2, Server 3.....Server 5000)associated to it. 

"Software 2" having 5000 servers associated to it including some same servers from "Software 1". 

Now if I updated "Software 1", it reindex "Software 1" and my script will triggered and will updating 5000 servers associated to it.  Consider first indexing is running already, and meanwhile I updated "Software 2". So as reindexing is already running, So I need to add these to Schedular logic which will triggered later. For that purpose, I need to know if indexing is already running or not. I think it should be preety clear now.

Hmm.  So you're saying "when I change issue 1, I have to change issue 2 as well"?

How, exactly, are you doing this "association"?  Because in most cases, you should be using that to trigger updates, NOT doing it later with your service (because that's broken and means you have inconsistent and contrary data which could break other things)

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

20,516 views 2 7
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you