Link to Bitbucket Issue Tracker from Commits

Still need help?

The Atlassian Community is here for you.

Ask the community

Purpose

This article should help users' commit text to link to their Bitbucket issues when they reference them in the form of "#1234"

Solution

If you want commit text to link to your Bitbucket issues when you reference them in the form of "#1234" for example, here's how you do it:

  1. Open your repository window
  2. Click 'Settings' in the toolbar
  3. Click 'Advanced'
  4. In the 'Commit Text Replacements' section, click 'Add'
  5. Select 'Other' for Replacement Type
  6. In the Regex Pattern field, enter "#(\d+)($|[^a-zA-Z0-9-])"
  7. In the Replace With field:
    1. On Mac, enter "<a href="https://bitbucket.org/your_username/your_project/issue/$1/">#$1</a>$2"
    2. On Windows, enter https://bitbucket.org/your_username/your_project/issue/$1
  8. Click OK twice
  9. Re-select the log item which has a mention of the #12345 style issue number, it should now be linked to the issue.

Note: this general pattern will work for any issue tracker that follows a similar pattern just by changing the URL structure.
Last modified on Feb 26, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.