make jira links clickable in github

Update 2022:

Dusan Plavak mentions in the comments that, as of today (Q1 2022), you can also import / automate creation of autolinks via github api.

You can also use gh api:

gh api repos/octocat/hello-world/autolinks \
       -f -q 'key_prefix:key_prefix url_template:url_template'

And since July 2022, you also have autolinks with alphanumeric IDs (for instance for a Trello card URL: https://trello.com/c/3eZr2Bxw).


2019: No need for Chrome plugin, Safari hack or scripts.

From October 2019, GitHub can automatically transform TICKET references to Jira links, for example.

See "Save time linking resources with autolink references" from Lars Schneider.

Now you can set up an autolink reference and GitHub will automatically create links (to external systems) for you.

https://i2.wp.com/user-images.githubusercontent.com/477434/66348334-994e1000-e956-11e9-8c87-9e871c221955.gif?resize=992%2C458&ssl=1

How it works

If you use GitHub with external services (like Jira), you might be familiar with shorthand references (like TICKET-123) to point to resources in those external systems.

Starting today, GitHub can automatically transform shorthand references into clickable links for GitHub Pro, Team, and Enterprise plans.

So not the regular github.com.

To enable this feature, a repository admin needs to register the reference prefix (such as TICKET-) in the settings.
Afterwards, references of that type are detected in issues, pull requests, comments, or commit messages, and turned into links.

This speeds up navigation between GitHub and external systems.

See documentation.

Note that the ticket prefix is not included in the hyperlink despite being included in the anchor text. The URL preview in the setting is accurate:

GitHub Autolinks are not so awesome for Jira

The animation in the feature announcement, replicated above, shows this limitation but not clearly.

This means that you have to either include the project key in the target URL as well or prefix all project keys with a another key and use that as the autolink prefix.

You cannot even use Git's trailers to reference tickets and use autolinks, because trailers are key-value pairs separated by : (colon space) and an autolink prefix that ends with a space is invalid.


I decided to make a Chrome extension for this ! This extension works on all websites, not just Jira ! :D

Install it here:
https://chrome.google.com/webstore/detail/jira-hotlinker/lbifpcpomdegljfpfhgfcjdabbeallhk

Source code:
https://github.com/helmus/Jira-Hot-Linker

Tags:

Github

Jira