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

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 Join to answer
Community showcase
Louis De Jaeger
Posted yesterday in Off-topic

Friday fun: your best joke

Hi all Lets make this Friday fun really fun and post one (or more) of your best jokes! The joke can be about an Atlassian product, or just a really fun joke you want to share! I’m not the best j...

49 views 2 2
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot