Streamline Your Development Workflow: Bitbucket and Jira Integration Guide

Plamen MushkovPlamen Mushkov
5 min read

Why is it a good idea?

In the world of software development, managing code changes and tracking project progress are two important aspects of the whole process. To improve the visibility and traceability of all changes, and most importantly see which code changes have been made to handle which specific Jira ticket, integrating Bitbucket with Jira is a very good idea. And speaking in general - integrating your version control tools and your ticketing system.

In the case with Bitbucket and Jira it is a lot easier, since both tools are owned by Atlassian. This integration allows developers to link their code commits, branches, and pull requests directly to Jira tickets. Here’s how this connectivity will benefit you and your team:

🔸 Easy to keep track - you can see exactly which code changes go with which project task. Just add the ticket number when you commit your code, and it links up automatically to the Jira task.
🔸 Updates in real time - as you push changes or merge code, Jira updates itself. So, if you finish a task, the ticket might close itself, or if there's a comment in Bitbucket, it shows up in Jira.
🔸 You can clearly see why certain code changes were made by looking at the linked Jira task.
🔸 Save time - instead of hopping between apps, you handle tasks and code in one place. It cuts down the unnecessary job of switching tabs or programs.

Step by step guide

  1. Open Bitbucket and select the Settings / Workspace Settings

  2. Select the Jira menu item from on the left

  3. You will see the Jira integration screen. Listed are all Jira sites to which you have access with the currently logged in user. To connect Bitbucket and Jira, click on the Connect button. In the popup window that will open, click on Grant access button. Note that you need to be an Administrator to complete the setup. Otherwise, ask you Admin to approve the step

  1. Once Access has been granted, go to your Bitbucket menu and open the Jira issues menu item. You should now see the issue from your Jira board.

  1. If you don’t see any Jira issues yet, you might need to check which Jira Projects have been linked to Bitbucket. To do so, click on the icon in the top right corner (a folder and a link icon). Then pick Manage linked projects. In the modal window that will open, select the Jira Projects you need to get linked and click on the Link project button. Once done, all issues of the selected Jira projects will appear on the page.

See it in action

To get a better idea of what this integration really means, let’s look at one basic example. We will first create a Jira ticket for a new feature. Once created, we will use the ticket number to create a new branch in our source control system (Bitbucket). On the next step we will do some code changes and commit them to the code repository. The result will be that the Jira ticket will get updated automatically and we will be able to trace the code changes to the ticket they were requested with.

💡
The most important part of the integration is to use the Jira ticket ID in the beginning of your branch name and in the beginning of your commit comments. For example git checkout -b APX-6-<branch-name> when creating new branch and git commit -m “APX-6 <commit message>“ when doing a commit.
  1. Create a new Jira ticket. For this example, my ticket ID is APX-6.

  2. Once the ticket is created, take a look at the Development section of the Details on the right. There are two new options there - Create branch and Create commit. They can suggest you how to create a new branch, using the Ticket ID or how to make a commit to a branch using the Ticket ID. Take a look at the example below.

    💡
    As you can see, Create branch provides the option to configure the default branch name format used by the suggestions.
  3. Next step is the actual development. For this demo I have created a new branch using the suggested command from Jira: git checkout -b APX-6-create-samples-table

  4. I have added a new file in my new branch APX-6-create-samples-table (demo_users.sql) and committed the changes using the suggested command: git commit -m “APX-6 New demo table created.“. What you’ll see now in your Jira Board is the integration in action. Next to the user icon, there is a new tiny icon, indicating that there is a new commit in the related Bitbucket repository.

  5. You can click on the Jira Ticket and explore the full details. You can notice that the Development section in Details is now showing the number of related Bitbucket branches and commits.

  6. You also have the option to Create a Pull request for the associated branch. The cool thing about this feature is that you get redirected to Bitbucket with all the necessary information about the Pull request pre-filled. This includes auto-generated Description, which consists of all comments about the existing commits in ascending order.

  7. Enjoy your new setup! I’m sure it will make your life as a developer easier and will give you that level of traceability and automation that can speed up the development process.

Follow me

Did you like this blog post? Follow me! 🔔

1
Subscribe to my newsletter

Read articles from Plamen Mushkov directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Plamen Mushkov
Plamen Mushkov

Creating apps built with ❤️ using Oracle APEX. PL/SQL dev. Exploring the AI and ML world. Keen on front-end, visual arts and new technologies. Love travel, sports, photography.