Reindex Issues

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()
Copy

By default, only the issue and its change history are reindexed. This behavior is to prevent performance issues when reindexing many associated entities: JRASERVER-72469

If you want to also reindex the comments or worklogs of an issue, see the examples below.

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()
        }
Copy



Related content

On this page