Reindex Issues
Understand when and how to manually reindex Jira issues using HAPI, and when automatic reindexing handles it for you.
When you update an issue with HAPI, the issue is reindexed automatically. In general, you shouldn't need to manually reindex an issue, however there are cases where you might want to. For example, when a modification has been made directly in the Jira database, and you want to reindex impacted issues
We've therefore made it easy to reindex issues using HAPI.
Reindex an issue
To reindex an issue with HAPI, call the reindex method an instance of Issue. For example:
Issues.getByKey('SR-100').reindex()Reindex an issue with comments/worklogs
By default, when using the method above, only the issue and its change history are reindexed.
To reindex an issue and its comments and/or worklogs, call the withComments and/or withWorklogs methods within a closure. For example:
Issues.getByKey('SR-100').reindex {
withComments()
withWorklogs()
}