Auto reindex with SIL admReindex() function

I would like to call the admReindex() function to reindex JIRA once per week on Sunday morning at 1 AM which during our maintenance window.  I have looked for a way to automate calling this SIL function and cannot locate a time based function in which to call admReindex().   Is there an approach someone from Kepler-rominfo  can recommend.

3 answers

1 accepted

2 votes
Answer accepted

Hi Craig,

In case you still need it, since JJUPIN 3.0.8 scheduler services have been implemented.
They are available only for JIRA versions greater that or equal to 6.2. smile


Hope this helps,

I will have to upgrade our JJupin to try this approach. We are on Jira 6.3.9. So no problem. In practice the approach I mentioned above worked in test but DID NOT work in Prod. In fact, it corrupted my index. Thanks

You should ask for support when running into problems, It's a joy to work with Kepler team.

Hi there,

I don't know if that is the "proper" way to do it, but for sure one of the easiest way to do this is something like this:

Set up a SIL service with 1h interval and with following SIL sript:

string CurrentDayOfWeek = dayOfWeek(currentDate());
number CurrentHour = hour(currentDate());

logPrint("INFO", "Weekly reindex service initiated. Checking timestamp...");
if (CurrentHour == 1 && CurrentDayOfWeek == "Sun")
	logPrint("INFO", "Timestamp correct. Beginning reindex.");
    logPrint("INFO", "Timestamp incorrect. Service aborted.");


I think the more bulletproof way would be to call one global service with a short timer like 5 minutes. This service could look into the database, check last and next execution times of the dependant services and execute the ones that meet the conditions. Never done it this way but this approach could get rid of few drawbacks of JIRA interval-timed services.

@Błażej Olszyca This seems a most reasonable approach. I will try it on our test instance and see how it goes. Thank you --Craig

@Błażej Olszyca Yes this does work well. Thanks

Hi Craig,


JJupin doesn't have a cron-like service yet, if your instance won't be restarted you can use a SIL Service with a high enough delay. You can also create a cron job yourself and, using curl, you can call the runScript REST method ( ). The script can be anything you like, including admReindex. 




@Silviu Burcea Hi, I will investigate this approach as well. Thanks --Craig

@Craig Leigh Alexandra's answer outperforms mine, it's the right way and her answer should be accepted too.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted yesterday in United States

From Atlassian: Confluence Security Advisory - 2019-03-20

Atlassian released a security advisory on 3/20/2019.  The full advisory is here: In a nutshe...

21 views 0 1
View post

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