Hooks & APIs

Webhooks

Trigger immediate reindex of your repositories from remote systems via webhooks.  For more information about this topic, see About GitLab Webhooks open in new tab .

Go to  cog Administration  > Add-ons  >  Git Integration Plugin for Jira > Webhooks.

helpful tip
If using Jira 7, go to Administration  > Add-ons. Select Applications on the page tab. Under Git Integration Plugin for Jira on the sidebar, select Webhooks.

Enable/disable the webhook feature by clicking on the Enable webhook checkbox.

The Secret Key is a secure random-generated alphanumeric string at the time of the Git add-on installation.  The user can change this to a different value by generating another secret token according to your Git host.

Use this key in the form of:

<JIRA_BASE_URL>/git/webhook/reindex/<SECRET_KEY>
fyi
All the repositories will be reindexed if the URL specified above is activated through  GET ,  POST , or  PUT  and the webhooks are enabled.

There will be no authentication checking and support for other HTTP methods such as  DELETE  or  HEAD .  The body of a  POST  or  PUT  is ignored.

The Git Integration for Jira add-on supports GitLab push event to define individual repository to index.

The webhook parses the following payload formats:

GITLAB
{
  "repository": {
  "git_ssh_url": "git@gitlab.com:testuser01/test-master.git",
  "git_http_url": "https://gitlab.com/testuser01/test-master.git"
  }
}
GITHUB Introduced v2.7.10
{
  "repository": {
    "git_url": "git://github.com/testuser01/test-repo.git",
    "ssh_url": "git@github.com:testuser01/test-repo.git",
    "clone_url": "https://github.com/testuser01/public-repo.git",
    "svn_url": "https://github.com/testuser01/public-repo"
  }
}

 

Assign your Jira base URL and Secret Key to the sample URL structure:
<JIRA_BASE_URL>/git/webhook/reindex/<SECRET_KEY>


Example:
https://your.jira.com/rest/gitplugin/webhook/1.0/reindex/sdf34tGdfgGDG345g3y0045TYG23te37