How To Link Pull Requests to Issues Using GitHub

Learn how to link PR and MR to issues using Github and auto-closing keywords to improve your engineering metrics reporting.

Thomas Williams
Thomas Williams LinkedIn
• 5 min read
How To Link Pull Requests to Issues Using GitHub

You can link a pull request (PR) to an issue in a Git repository to show that a fix is in progress and to automatically close the issue after merging pull requests.

Keypup uses context inference and link detection to automatically enrich your datasets, populate new fields and simplify your reporting. Linking pull requests to issues in your development tools (e.g., GitHub, GitLab, Bitbucket) using auto-closing keywords allows Keypup and third-party tools to access and expound the information.

How Linking Pull Requests to Issues Benefits Your Reporting in Keypup

Linking issues to pull requests allows Keypup to populate and improve the following fields:

  • Issues & Pull Requests > Due on: When a pull request is linked to one or more issues, Keypup automatically infers the due date by taking the soonest of all due dates across the pull request and its related issue(s).

  • Issues & Pull Requests > Resolution State: This field is only applicable to issues. It infers the implementation status of the issue by looking at the associated pull requests. The field can have the following values:

  • None: The issue has no attached pull requests. It is not being implemented.

  • In progress: The issue has at least one open pull request attached to it.

  • Implemented: All attached pull requests are merged or closed.

These two fields can be used to refine your metrics and/or drill down on specific data (e.g., retrieve the list of overdue issues that are not being currently resolved by a pull request).

Moreover, your links between issues and pull requests are automatically grouped in your card insights. Each card is populated with the references of issues and pull requests, cross-app comments, due dates, global timeline, etc. This way, you have a single point of entry to see everything related to your linked issues and pull requests, and you can even track your average pull request size.

Image

Linking Issues to Pull Requests Using GitHub

Option 1: Via the pull request title

To link a Jira issue such as PROJ-123 or a GitHub issue such as my-org/my-project#475 to a PR, you can set your pull request title to:

  • [PROJ-123] Resolve problem with login button
  • [my-org/my-project#475] Resolve problem with login button

Option 2: Via the pull request body or a commit message

To link issues to PRs using a body or commit message, the reference or URL of your issue must be prefixed by an auto-closing keyword, such as “fixes,” “resolves” or “closes.” For instance:

Linking Issues to Merge Requests (MR) Using GitLab

Option 1: Via the merge request title

To link a Jira issue such as PROJ-123 or a GitLab issue such as my-org/my-project#475 to a MR, you can set your merge request title to:

  • [PROJ-123] Resolve problem with login button
  • [my-org/my-project#475] Resolve problem with login button

Option 2: Via the merge request body or a commit message

To link issues to merge requests via a MR body or commit message, the reference or URL of your issue must be prefixed by an auto-closing keyword, such as “fixes,” “resolves” or “closes.” For instance:

  • This MR updates the handler attached to the login button. Fixes PROJ-123.
  • Fix login button. Closes https://myorg.atlassian.net/browse/PROJ-123.
  • Fix the login. Closes my-org/my-project#475.
  • This is a fix. Resolves https://gitlab.com/my-org/my-project#475.

Linking Issues to Pull Requests Using Bitbucket

Option 1: Via the pull request title

To link a Jira issue such as PROJ-123 or a BitBucket issue such as my-org/my-project#475 to a PR, you can set your pull request title to:

  • [PROJ-123] Resolve problem with login button
  • [my-org/my-project#475] Resolve problem with login button

Option 2: Via the pull request body or a commit message

To link issues to pull requests using a PR body or commit message, the reference or URL of your issue must be prefixed by an auto-closing keyword, such as “fixes,” “resolves” or “closes.” For instance:

‍

Ready to Transform Your Analytics?

Join teams already using AI to make data-driven decisions faster than ever.

Most Recent Articles

The Approval Ring: When the Same Two Engineers Keep Approving Each Other's Pull Requests

The Approval Ring: When the Same Two Engineers Keep Approving Each Other's Pull Requests

A four-eyes review policy checks that someone else approved a pull request, not who. In a typical enterprise, 168 pairs of engineers mostly approve each other, on 17% of merged pull requests and 26% of the code. Learn what engineering leaders on Reddit say about reciprocal approvals and rubber-stamp review buddies, and how Keypup MCP measures approval concentration from review authors, pull request authors, review dates, review bodies and lines changed.

Liam Davis
The Mega-Ticket: When One Jira Issue Turns Into Fifteen Pull Requests

The Mega-Ticket: When One Jira Issue Turns Into Fifteen Pull Requests

Throughput counts issues, but one closed issue can hide one pull request or fifteen. In a typical enterprise, 14% of closed Jira issues need six or more pull requests, carry half the code that changed and take eight times longer to close. Learn what engineering leaders on Reddit say about tickets that never get split, and how Keypup MCP measures issue size through linked pull requests, lines changed, merge spans and story points.

Stephane Ibos
The Survivorship Trap: Your Cycle Time Only Counts the Work That Finished

The Survivorship Trap: Your Cycle Time Only Counts the Work That Finished

Cycle time is measured on closed work, so the items stuck in Blocked, In Review or QA for weeks never appear in it. In a typical enterprise, the median open item is twice as old as the median closed one, and a third of work in progress is already older than the 85th percentile the dashboard reports. Learn what engineering leaders on Reddit say about green cycle time charts and stuck work, and how Keypup MCP measures the age of open Jira issues, where they sit still and what code is behind them.

Arnaud Lachaume