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 .

Adding Webhooks to Connected Repositories Jira SERVER

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

helpful tip
If using Jira 7, go to Administration  > Applications.  Under Git Integration Plugin for Jira on the sidebar, select Web Hooks.
Git Repositories reindex web hook

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 the 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.

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

Adding Webhook for GitHub Repository

 

Configure webhook by logging in to your GitHub account:

  1. Select a repository.
  2. Go to the Settings page.
  3. Github webhook settings
  4. Select Webhooks & services.
  5. Click Add webhook.  The following page is displayed:
  6. GitHub Webhooks - Add webhook
  7. Paste the obtained Secret URL from the Git Integration for Jira add-on  >  Webhooks page into the Payload URL field.
  8. Select the Just the push event option as triggering event.  This is the default option when creating a new webhook.
  9. Click Add webhook to save the new webhook settings.
fyi
Webhooks will be automatically registered for each GitHub repository connected to JIRA Cloud to instantly index your commits.  For this to work, the connecting GitHub user must be the Organization Owner or have repository ADMIN rights.
Webhooks will be deleted when GitHub integration is disconnected from Git for JIRA Cloud.
cite
v2.12.8Git Integration for Jira will index only the updated repositories as indicated by the GitHub organization or GitLab group webhook.

Adding Webhook for GitLab Repository

 

Configure webhook by logging in to your GitLab account:

  1. Select a repository.
  2. Go to the settings page by clicking the cog icon, then
  3. Select Webhooks.
  4. Gitlab webhooks setting
    The following page is displayed:
    GitLab Webhooks - Add webhook
  5. Paste the obtained Secret URL from the Git Integration for Jira add-on  >  Webhooks page into the Payload URL field.
  6. Select the Push events as a triggering event option.  This is the default option when creating a new webhook.
  7. Click Add webhook to save the new webhook settings.

Adding Webhooks to Connected Git Repositories Jira CLOUD

Before you can add a webhook to your favorite git repository, you need to enable it in the git repositories configuration page.

Click the Git menu on your Jira Dashboard, then select Manage Git Repositories.

The following screen is displayed:

Manage Git Repositories page Webhooks

Click Webhooks.

On the following dialog, enable/disable the webhook feature by clicking on the Enable webhook checkbox.

Enable webhooks screen

When enabled, the Git add-on will also provide a webhook URL for use with the repository webhooks setting of your git host.

Copy the webhook URL to the system clipboard by clicking the copy to clipboard icon icon.

Click Save to save the settings.

After enabling the webhooks feature, you can access the webhook URL from the other locations in the Manage Repositories page:

  • Click a tracked repository or a single repository URL in the Git repositories list.
  • Tracked repositories webhook URL source access
  • Click the cog Actions icon for the connected single repository then select Edit. For the connected tracked repository, select Show tracked repositories then click a repository URL on the next screen.

Watch the video below to learn on how to add webhooks to your connected git repositories in Jira Cloud.  It covers adding webhooks to GitHub, GitLab, Bitbucket Cloud and VSTS and shows where to get the webhook URL.

Webhook GitHub Organization Support

As of v2.12.8 of the Git Integration for Jira add-on, GitHub Organization webhooks is now supported.  Rather than creating a webhook for each repository manually, configure the webhook at the GitHub Organization level to automatically register webhook for each repository.

GitHub Organization Webhooks - Adding webhook

To configure GitHub organization webhook:

  1. Login to your GitHub account and go to your GitHub Organization.
  2. Go to Settings.
  3. Under Organization Settings, go to Webhooks.
  4. Click Add webhook.
  5. Paste the webhook URL into the Payload URL field. (The webhook url is acquired from the Git Integration for Jira add-on webhook configuration page.)
  6. Select/enable the "Just the Push event" trigger.
  7. Click Add webhook to complete this setup.