JIRA Auto-Re-index

It can be helpful to schedule a re-index of issues after hours. Here is the shell script that can make that happen:

#!/bin/sh
### SETTINGS ###
USERNAME=<admin_username>
PASSWORD=<password>
DASHBOARD_PAGE_URL=http://<JIRA_URL>/secure/Dashboard.jspa
INDEX_PAGE_URL=http://<JIRA_URL>/secure/admin/jira/IndexReIndex.jspa
COOKIE_FILE_LOCATION=jiracoookie
### COMMANDS ###
curl -u $USERNAME:$PASSWORD –cookie-jar $COOKIE_FILE_LOCATION –output /dev/null $DASHBOARD_PAGE_URL
curl –cookie $COOKIE_FILE_LOCATION –header “X-Atlassian-Token: no-check” -d “indexPathOption=DEFAULT” -d “Re-Index=Re-Index” -d “indexPath=” –output /dev/null $INDEX_PAGE_URL
rm $COOKIE_FILE_LOCATION

Advertisements

One thought on “JIRA Auto-Re-index

  1. Pretty nice post. I just stumbled upon your weblog and wished to say that I’ve really enjoyed browsing your blog posts. In any case I’ll be
    subscribing to your feed and I hope you write again very soon!

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s