Atlassian Jira and GitLab Integration Tutorial: Installation & Configuration
JIRA is a very powerful issue and project tracking tool and is most popularly known by its use for bug tracking as well.
The other tools from Atlassian suite which cover the ALM approach and that are tightly integrated with JIRA are the Confluence for collaboration among the project teams and Zephyr for complete test management activities.
Hence you could see that the above 3 tools are tightly integrated and provide the teams with an end to end visibility of all the project artifact status and progress.
One of the important steps in this whole process is to know how we LINK the tasks/bugs to the source code that is in the Git repositories especially using Gitlab. This process is very important for considering traceability and transparency of the code changes to the tasks assigned to the developers.
GitLab is a web-based Git repo manager that provides source code repository, project planning features and CI / CD capabilities.
In this article, we will see how a JIRA task will be linked to the source code changes during a Git commit for the repository cloned from Gitlab.
Recommended Reading=> Atlassian Jira Training Series
Table of Contents:
Pre-Requisites
- JIRA 7.3.X installed.
- Gitlab Enterprise edition 11.x project created with files added to the repository.
Install the Git plugin to JIRA and Configuration
The first step in integration is to install the Git plugin into JIRA.
Launch JIRA to install and upload the plugin as shown below. Go to the Settings -> Add-On -> Manage add-ons and Upload add-on option and upload the plugin.
The Git integration for Jira add-on or Plug-in installed is shown in the below image.
Refresh the page once after the add-on is installed. This plugin is not free and will need to be purchased. I have used an eval license to showcase the integration. This plugin or add-on will help to see Git commits linked to the JIRA issue.
As the Git add-on is uploaded, you need to add the Git repository URL from the Gitlab. Click on Configure to add and connect to the Git repository.
Following is the Git repository URL which is entered. You can get the details of this from your Gitlab project.
Click on Next.
Enable the options as shown below and select the Jira project for integration. Click on Finish.
Once the Git repository URL is entered, Edit the repository settings to add the user id and password to connect with. If your company LDAP is used and configured with Gitlab then enter the same in the settings.
Enter the details for username and password and click on Update.
Click on Update once done.
Back in the JIRA project, I have created a sub-task for a story which will be used during the Git commit. Also, note that the Jira Key is DEM-4.
Jira Configuration in Gitlab
In the previous section, we saw how to add Git repository details to the Jira server. In this section, we need to add the Jira server details as well in Gitlab. Always remember 2-way communication is required in this integration.
Open the Gitlab project and go to Settings -> Integrations. Scroll down to the Jira section and click on it to configure the Jira server details.
Enable the details as shown, enter the Jira server URL, username and password. Test and Save the settings. Once the settings are saved, you should see a GREEN circle next to Jira as shown. This shows that the Jira server is connected from Gitlab and the integration is completely enabled.
In order to proceed with integration, clone the Gitlab repository to the local machine. Normally a developer would clone to his local machine, modify files and commit/push the changes back to the Gitlab repository.
The above repository (https) is cloned to a local machine. Perform some changes to the file and commit the changes.
While committing the changes, enter the Jira key (DEM-4) as shown using the git commit command. After the commit is done push the changes back to Gitlab.
The above format will ensure that the changes done to the source code in the Git repository is added to the Jira issue (DEM-4) as shown.
Conclusion
As teams across different organizations use either SVN or Gitlab, this integration with Jira will help to provide better transparency of source code changes during the SVN or Git commits.
Thus this tutorial on Jira integration and Gitlab showcase one of the powerful and much-needed integration features to be considered important during any ALM implementation.