Simplifying GitHub Workflows: Enhance Collaboration with Jira Integration

Linking Jira Tickets in GitHub Pull Requests Made Simple

Alex Harrisson
Axel Springer Tech
3 min readJan 24, 2024

--

Enhance Collaboration within your Team
Enhance Collaboration within your Team - Photo by Annie Spratt on Unsplash

Many software companies or teams, including us (the WELT native apps team at Axel Springer), rely on agile project management tools like Jira to efficiently create and organise their tickets, encompassing various aspects such as herding bugs, hatching new features, or making improvements that occasionally make everything even more complicated.

Introduction

When developers complete their assigned tickets, the next adventure awaits … often times this involves creating a Pull Request (or PR) on a version control system. We at Axel Springer, like so many others, live in the GitHub realm.

Subsequently, fellow developers review the PR, and to streamline the process, it’s common practice to include the ticket number along with a link referencing the corresponding Jira issue, so that other Engineers can easily see what you worked on and understand the context better.

However, one notable inconvenience arises on GitHub — unlike other platforms, it doesn’t permit linking directly from the Pull Requests title; instead, links are confined to the description using markdown syntax. This necessitates a manual process of navigating to another tab, copying the Jira link manually, and pasting it into the description. It’s like GitHub is saying: ‘No shortcuts here, my friend! 🙅‍♂’.

To simplify this task, a handy feature that configures autolinks to both external and internal resources can be enabled in the repositories settings page.

As of now, this feature is a special treat for paying customers and exclusively available for administrators in repositories with premium plans such as GitHub Pro or GitHub Team. Hopefully this changes in the future 🤞

Setting Up the Process

To set this up, simply navigate to the repository’s settings page and click on Autolink references on the sidebar. Here, provide GitHub with a reference prefix, which is the identifier for your ticket.

An example of our ticket structure is CURR-12345, with CURR- serving as the prefix and 12345 as the unique identifier for the ticket.

The first part of the ticket is the reference prefix and the second part is the ticket identifier.

Next up is the Target URL, this represents the base link for the ticket, and includes a placeholder variable called <num> at the end to accommodate GitHub’s nomenclature. For example, a target URL might look like:

https://jira.example.com/browse/CURR-<num>

To determine your Target URL, simply open a Jira ticket, copy the link, remove the identifier, and replace it with the <num> variable.

Simply provide GitHub with a reference prefix and a Target URL.

Once you’ve reviewed and made your changes, you’re good to go. Every PR that contains a ticket number, such as CURR-12345 will now automatically link to the corresponding Jira issue once published.

This not only enhances efficiency but also extends its magic to commit messages, not just Pull Requests. Whether configured automatically or added manually, ticket numbers now effortlessly link to Jira by default 🎊

The ticket seamlessly links to its corresponding Jira issue, appearing automatically in both the description and the commit message
The ticket seamlessly links to its corresponding Jira issue, appearing automatically in both the description and the commit message

The possibility of automatically adding the ticket numbers in commit messages, perhaps by extracting them from the branch name, sounds like a potential adventure for a future blog post 😉

For additional information, refer to the official GitHub Documentation for this feature.

Thanks for reading.

Written with ☕️ in Berlin 🇩🇪
by Alex H.

--

--