...
Excerpt | ||
---|---|---|
| ||
A ScriptRunner 'canned script' which reindexes only issues in particular projects. |
Warning |
---|
Updated for Jira 9.x, although TBH I haven't tested it too thoroughly. |
JIRA's reindex screen will be familiar to JIRA admins:
...
- Ensure you have the ScriptRunner for JIRA plugin installed.
- On the filesystem, go to the
scripts/
directory in your JIRA Home Jira home directory (henceforth $JIRAHOME) directory (create it if not present).you should see ascripts/
directory created by ScriptRunner. cd
into this directory,$JIRAHOME/scripts
- Download the attached reindexprojects.zip
cd
to the the server into$JIRAHOME/scripts
/ . I do this by right-clicking, copying the URL ($url
), then runningcurl -LOJ $url
unzip reindexprojects.zip
- directory and unzip. You should now have a file,
$JIRAHOME/scripts/com/onresolve/scriptrunner/canned/jira/admin/ReindexProjects.groovy
- In JIRA type
.
orgg
to bring up the admin search, and search for 'Built-in Scripts':
- You should now see a new Reindex projects built-in script:
- Click 'Reindex projects', pick the projects you want to reindex, and click 'Preview' or 'Run':
..and voilà.
You might have noticed, there is already a built-in script called "Reindex issues", which does indeed claim to reindex particular projects:
This "reindex" works by.. doing a JIRA search for issues by filter or project, and then reindexing them. Can you spot the flaw in that scheme? Correct - if your indexes are broken to begin with, it's not going to work (and why would you be reindexing unless your indexes were broken?).
The source code, ReindexProjects.groovy is is open source. I've reached out to Adaptavist and hopefully they'll incorporate my per-project reindex code.
...