Skip to end of metadata
Go to start of metadata

Users with administrative rights on a repository can create Links to external applications. Links allows Bitbucket comments and commit messages to reference pages in external programs such as JIRA or Jenkins.  They can also give these external systems the means to reference information in Bitbucket.  These references typically take the form of hypertext links which is why the feature is called links.  By default, Bitbucket provides the following default links:

ServiceDescription
JIRAProject tracking software from Atlassian. Use JIRA to collect user feedback and track issues.
Bamboo

Continuous integration, deployment, and release management.

(warning) Bamboo Cloud does not support this feature.

Crucible

Peer review software. Helps you find bugs and improve code quality.

(warning) Crucible Cloud does not support this feature. 

JenkinsAn extendable open source continuous integration server

To establish a link to any of these projects, you need to supply a server URL and a key. If you have existing references to a key from a service in your repository, setting up the service retroactively resolves them for you. Links only go from Bitbucket to the service. To view commit messages within the service itself, you need an extension to the service such as the Use the JIRA DVCS Connector Add-on.

Linking your repository to an external application

  1. Go to the repository settings.
  2. Select Links from the left hand menu.
  3. Click on the application you want to link.
    The Repository Link dialog appears.
  4. Enter a URL and a key value.
    The key value is case sensitive.
  5. Press Save.

After you have set up several Links the page appears as follows:

When entering a commit message locally, you reference a specific KEY and value from the service. For example, the BB-4409 value in the following commit message:

 hg commit -m "BB-5792 Profile page website opens in a new window/tab"

Appears in Bitbucket as a link on the commit tab:

8 Comments

  1. Anonymous

    Custom Links seems not to be working. I've defined one for my repository as:

    Replacement URL: http://mysite/RestAPI/View/\1
    RawRegex: 
    #(\d+)

    But no links are created for my commit messages, that look like:

    #123 some description

    I can't find more info on Curtom Links. What's wrong?

    Regards,

    1. Anonymous

      This was mentioned in a blog post last year: #\d is a system regex that takes precedence over personal expressions. Sad but true.

  2. Anonymous

  3. How can I set up Jenkins links? What is the Build key?

    1. I figured out. It is just a job name on Jenkins. Thanks.

      1. Thank you for taking the time to comment. (smile)

        Happy coding,

        Dan

      2. Is it regex or must match the job name exactly? Do you know if it is possible to setup this to point to multiple jenkins jobs, i.e. when building each branch separately?

        1. I don't know if it matches multiple job names by regex, but I hope an expert at Atlassian would answer your question.  Anyway, you can make as many links as you wish and I wouldn't need such a feature so seriously.