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

Contact Support: Server  
Contact Support: Data Center  

Associate Pull/Merge Requests to Issues Based on Commits

Introduction

Starting with v3.7.2+ of the Git Integration for Jira Server and Data Center app, we have added a new setting that allows for pull request (PR) and merge request (MR) indexing via API in General Settings. Additionally, in earlier versions, automatic indexing of PR/MRs cannot be avoided for auto-connect integrations.

Pull/merge requests appear automatically in the Git Integration panel based on the commits associated with the pull/merge request. This allows users who did not mention a Jira issue key in the PR/MR title or description, they will still be linked.

Getting Started

The following settings are implemented in the Manage git repositories page ➜ General settings under Git pull/merge requests:

Enable pull/merge request creation in Jira issues

This setting will show or hide the function for creating pull/merge requests from the Jira developer panel. This setting is ON by default.

Enable indexing pull/merge requests via API

This setting will index PR/MRs that are associated to Jira issues based on pull/merge request title which includes the Jira issue key. This setting is ON by default.

Turn off this setting for improved Jira performance. Note that the API calls increase the number of calls to the git server – by one additional API call per each merge/pull request.

There are corresponding API calls to get merge/pull request commits, at least in the below integrations:

Enable indexing pull/merge requests by commits

This setting will index PR/MRs that are associated to Jira issues based on commits related to pull/merge requests with commit message containing a Jira issue key. This setting is OFF by default. Users will not be able to toggle this setting to ON/OFF if the Enable indexing pull/requests via API is switched OFF.

Turning this setting ON does not call commits on acquiring for existing pull/merge requests in their unchanged state. As a result, the Git Integration app won’t be filling the commit association information for already connected integrations.

Commits will be indexed for new/changed PR/MRs only. This will significantly reduce the number of calls to the git server. The current implementation automatically detects changes even for Microsoft pull requests which doesn’t have the lastUpdateTime field.

When switched to ON, the Enable indexing pull/merge requests via API setting completely activates the feature of indexing of PRs/MRs. This also allows users to use the toggle control for the Enable indexing pull/merge requests by commits setting, which provides an additional way of indexing when switched to ON.

Guidelines

What to do with the rate limit issues?

With the index settings above, the rate limit issues can be ignored. At least, the user may turn the feature off, connect an integration, wait until the reindexing is completed, and then turn the feature back on.

Do I need to do a Reset index?

The commits for existing PR/MRs are not needed to be retrieved again, so there’s no need to do a reset index.

Will this affect repositories with webhooks? Will webhooks trigger reindexing a repository via API to get PRs via commits?

Yes, Any indexing of repo (manually, via API, webhooks) will call reindexing a repository to get PRs via commits

Recommendations

We highly recommend setting the Reindex Interval setting (in General Settings) to no longer than every 24hrs when possible.

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