« Hooks & API

Reindex

Last Updated: March 25, 2019

Call the Reindex REST API to have more control on indexing:

 
Reindex POST API
url
/rest/gitplugin/1.0/index.json

Queues the given repository to be reindexed in the indexing thread and returns the result immediately.
important
There are two types of users who can perform the Reindex POST API call:
  1. Jira administrators
  2. Jira user who has all of the following:
    1. View/browse permissions to the project;
    2. View Development Tools permissions to the same project; and
    3. The repository is associated to the project.
method
POST
parameters
repoId       Repository ID (long).  Query parameter.  Required.

Example: Form param (repoId: 12)
response
JSON

 

Example:
Example:
http://jira.yourorg.com/rest/gitplugin/1.0/index.json

Response:
{
  "success":true,
  "finished":true,
  "threadId":172,
  "messages": {
    "Indexing test-repo":100.0
    },
  "errors": {},
  "lastOperationPercent":100.0
}
 
Reindex GET API
url
/rest/gitplugin/1.0/index.json

Use this method to track messages for a particular thread.
important
There are two types of users who can perform the Reindex GET API call:
  1. Jira administrators
  2. Jira user who has all of the following:
    1. View/browse permissions to the project;
    2. View Development Tools permissions to the same project; and
    3. The repository is associated to the project.
method
GET
parameters
threadId     Indexer thread ID (UUID).  Query parameter.
Required.
Example: eafe58fc-d8de-42ff-8815-6fe5860b38d2
response
JSON

 

Example:
http://jira.yourorg.com/rest/gitplugin/1.0/index.json?threadId=eafe58fc-d8de-42ff-8815-6fe5860b38d2

Response:
{
  "success":true,
  "finished":true,
  "threadId":172,
  "messages": {
    "Indexing test-repo":100.0
    },
  "errors": {},
  "lastOperationPercent":100.0
}

« Hooks & API