Skip to content

Instantly share code, notes, and snippets.

@AubreyHewes
Created June 27, 2013 09:45
Show Gist options
  • Save AubreyHewes/5875278 to your computer and use it in GitHub Desktop.
Save AubreyHewes/5875278 to your computer and use it in GitHub Desktop.
JIRA Re-Index script
#!/bin/sh
### CUSTOM SETTINGS ###
USERNAME=<jira_username>
PASSWORD=<jira_password>
HOSTNAME=<jira_hostname>
### FIXED SETTINGS ###
DASHBOARD_PAGE_URL=http://${HOSTNAME}/secure/Dashboard.jspa
INDEX_PAGE_URL=http://${HOSTNAME}>/secure/admin/jira/IndexReIndex.jspa
COOKIE_FILE_LOCATION=jiracoookie
### COMMANDS ###
# login
curl -u ${USERNAME}:${PASSWORD} \
--cookie-jar ${COOKIE_FILE_LOCATION} \
--output /dev/null ${DASHBOARD_PAGE_URL}
# execute re-index
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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment