March 28th 1 PM ET
Free Workshop: Escape the chaos of context-switching

Git Integration for Jira Self-Managed (Data Center/Server) Documentation

Reindex POST API

Starts the reindex process in a separate thread and returns the result immediately.

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:
    • View/browse permissions to the project;
    • View Development Tools permissions to the same project; and
    • The repository is associated to the project.

For users that have GIJ v4.16 and below and haven’t upgrade to v4.17 yet, jump to this section.

 

url

/rest/gitplugin/2.0/reindex NEW IN v4.17

The old URL format (/rest/gitplugin/1.0/index.json) is deprecated starting GIJ v4.17.

For improved security, we recommend users to upgrade to v4.17.

method

POST

content-type

application/json

Parameters

Request body is a JSON structure.

Field Description
repoId Integer. Optional.

If repoId is left as blank, the API will perform a reindex of all repositories.

priority Integer. Optional.

Set the priority of the operation. Default value is 24. Any value greater or equal to 1 is allowed.

The tasks in the queue are executed in descending order of priority. The Git Integration for Jira app internally uses the following priorities for operations:
24 — Manual reindex
22 — Webhook reindex
20 — Scheduled reindex
10 — Remove repository
  2 — Git GC

Response

JSON

Example with repoId assigned:

http://jira.yourorg.com/rest/gitplugin/2.0/reindex

Body, JSON(application/json):
{
  "repoId": 133
}

-----------------------

Response:
{
  "success": true,
  "finished": false,
  "threadId": "c3989477-053b-4cb7-965c-1ab54690490f"
}

Example with priority assigned:

http://jira.yourorg.com/rest/gitplugin/2.0/reindex

Body, JSON(application/json):
{
  "repoId": 133,
  "priority": 20
}

-----------------------

Response:
{
  "success": true,
  "finished": false,
  "threadId": "c3989477-053b-4cb7-965c-1ab54690490f"
}

Example with blank repoId:

http://jira.yourorg.com/rest/gitplugin/2.0/reindex

-----------------------

Response:
{
  "success": true,
  "finished": false,
  "threadId": "18cc6873-2b75-45b3-ab86-a6b1d09f6c9f"
}

 

For GIJ 4.16 users and below

For improved security, we recommend users to upgrade to v4.17.

This section will be removed after January 1, 2024.

url

/rest/gitplugin/1.0/index

method

POST

content-type

multipart/form-data

Parameters

Request body is a multipart/form-data structure.

Parameter Description
repoId Form parameter.

This is the repository ID.

Examples:
Form param (repoId=133)

Response

JSON

Example with repoId assigned:

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

Body, (multipart/form-data):
repoId=133

-----------------------

Response:
{
  "success":true,
  "finished":true,
  "threadId": xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
}

 


Reindex REST APIs

Reindex POST API (this page)

Reindex GET API

Have feedback about this article? Did we miss something? Let us know!
On this page