Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Ensure you have the ScriptRunner for JIRA plugin installed.
  2. On the filesystem, go to the scripts/ directory in your JIRA Home (henceforth $JIRAHOME) directory (create it if not present).
  3. Download the attached reindexprojects.zip
  4. cd to the $JIRAHOME/scripts directory and unzip. You should now have a file, $JIRAHOME/scripts/com/onresolve/scriptrunner/canned/jira/admin/ReindexProjects.groovy
  5. In JIRA type . or gg to bring up the admin search, and search for 'Built-in Scripts':


     
  6. You should now see a new Reindex projects built-in script:
     


  7. Click 'Reindex projects', pick the projects you want to reindex, and click 'Preview' or 'Run':

Image RemovedImage Added

..and voilà.


You might have noticed, there is already a built-in script called "Reindex issues", which does indeed claim to reindex particular projects:

Image RemovedImage Added

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.

...