For the complete documentation index, see llms.txt. This page is also available as Markdown.

Issue linking

Linking pull requests to issues allows you to group work by issues. This article describes the ways Swarmia can detect which issue a pull request is related to.

Why linking pull requests to issues is important

Linking pull requests to issues enables Swarmia to give you deeper insights into your work. Otherwise, we can't know what coding activity happened in an issue, meaning that we can only show you data from your issue tracker, giving a limited view to what actually happened.

A high linking rate is essential for making these features (and more) work well:

  • Investment balance

  • Software capitalization

  • Work log by issue

  • Initiatives

Issue key matching

If you use Jira or Linear with their respective plugins that label PRs to link them to their issue, we’ll leverage that information. In addition, Swarmia can automatically detect Issue links from PRs in any of the following ways:

  • Mention the issue key in the Pull Request title (e.g. Foobar [CLOUD-123])

  • Mention the issue key at the beginning of the Pull Request description (e.g. CLOUD-123 description description description)

  • Add the issue key URL (e.g.https://acme.atlassian.net/browse/CLOUD-123) in the Pull Request description.

  • Start the Branch name in GitHub with the issue key (e.g. CLOUD-123-foo) or use it after a slash (e.g. myname/bug/CLOUD-123-foo)

GitHub Issues

GitHub issue numbers are only unique within a repository, so Swarmia identifies a GitHub issue as owner/repository/number, for example acme/backend/482. You never have to type that key. Swarmia links a pull request to a GitHub issue when:

  • GitHub links the two itself, for example when the pull request closes the issue

  • the pull request description says Closes #482, and the issue is in the same repository

  • the description contains the issue's GitHub URL, which works across repositories too

  • the title, branch name, or description mentions #482, and that number matches an issue in the pull request's own repository

A bare #482 links the pull request when it hits an issue, but it doesn't count as naming one, so AI-powered matching still runs for a pull request that only references a number.

AI-powered matching

This feature is currently in alpha and can be toggled on in Settings → Pull requests → Issue linking.

When enabled, Swarmia uses AI to link a pull request to an issue when the two appear similar in name or description. The link will only be created if the PR author and issue assignee match, and the issue has been in progress recently. The PR author will receive a Slack notification, and the link can be overwritten directly from Slack or inside the Swarmia app.

When enabled, you'll be prompted whether you want AI to match the last 6 months of PRs. The PRs linked in this operation won't trigger Slack notifications.

Show linked issues in GitHub

Swarmia can add a comment with the linked issue to GitHub pull requests. Organization admins can turn Add linked issue to GitHub pull request comments on or off in Settings → Pull requests → Issue linking.

Swarmia can automatically suggest relevant issues for a pull request based on its metadata. When a developer merges a pull request, for which we could not automatically determine the issue link, the Swarmia Slack bot will send them a message with suggested issue links:

Swarmia bot sends a Slack message where the developer can quickly link the pull request to the relevant issue or investment category

You can also manually search for the right issue, or link the pull request to an investment category if no relevant issue exists.

For these notifications to be enabled, these conditions need to be met:

  1. The author of the pull request must have Personal notifications enabled

  2. The team that the author belongs to must have adopted the "Link pull requests to issues" working agreement

Manually linking pull requests to issues

It's also possible to manually link pull requests to issues from the Swarmia UI. Open the pull request popup from any view by clicking on a pull request, and you can change the issue and investment category that it is linked to:

The pull request popup allows you to change its linked issue and investment category

Frequently asked questions

No. A pull request can only be linked to one issue in Swarmia.

Last updated

Was this helpful?