- Jira issues
You can use Jira to track work implemented in GitLab. The Jira integration with GitLab makes the process of working across these systems more efficient.
The GitLab Jira integration, available in every GitLab project by default, allows you to connect to any Jira instance, whether on Atlassian cloud or self-managed.
After you set up this integration, you can cross-reference activity in the GitLab project with any of your projects in Jira. This includes the ability to close or transition Jira issues when work is completed in GitLab and:
- Mention a Jira issue ID in a commit message or MR (merge request) and:
- GitLab links to the Jira issue.
- The Jira issue adds a comment with details and a link back to the activity in GitLab.
- Mention that a commit or MR resolves or closes a specific Jira issue and when it’s merged to the default branch:
- The GitLab MR displays a note that it closed the Jira issue. Prior to the merge, MRs indicate which issue they close.
- The Jira issue shows the activity and is closed or otherwise transitioned as specified in your GitLab settings.
- Run a pipeline on an MR linked to a Jira issue:
- The Jira issue shows the current pipeline status (in the sidebar as “builds”).
- Deploy to an environment from an MR linked to a Jira issue:
- The Jira issue shows the status of the deployment (in the sidebar as “deployments”).
- Create or modify a feature flag that mentions a Jira issue in its description:
- The Jira issue shows the details of the feature-flag (in the sidebar as “feature flags”).
- View a list of Jira issues directly in GitLab.
- Create a Jira issue from a vulnerability.
Additional features provided by the Jira Development Panel integration include:
- In a Jira issue, display relevant GitLab information in the development panel, including related branches, commits, and merge requests.
- Use Jira Smart Commits in GitLab to add Jira comments, log time spent on the issue, or apply any issue transition.
- Showing pipeline, deployment, and feature flags in Jira issues.
For an overview, see Agile Management - GitLab-Jira Basic Integration.
Each GitLab project can be configured to connect to an entire Jira instance. That means one GitLab project can interact with all Jira projects in that instance, once configured. For:
- The view Jira issues feature, you must associate a GitLab project with a specific Jira project.
- Other features, you do not have to explicitly associate a GitLab project with any single Jira project.
If you have one Jira instance, you can pre-fill the settings. For more information, see the documentation for:
To enable the Jira service in GitLab, you must:
- Configure the project in Jira.
- Enter the correct values in GitLab.
The process for configuring Jira depends on whether you host Jira on your own server or on Atlassian cloud.
Jira Server supports basic authentication. When connecting, a username and password are required. Connecting to Jira Server via CAS is not possible. For more information, see set up a user in Jira Server.
Jira on Atlassian cloud supports authentication through an API token. When connecting to Jira on Atlassian cloud, an email and API token are required. For more information, see set up a user in Jira on Atlassian cloud.
- The supported Jira versions are
- In order to support Oracle’s Access Manager, GitLab sends additional cookies to enable Basic Auth. The cookie being added to each request is
OBBasicAuthwith a value of
To enable the Jira integration in a project:
Go to the project’s Integrations page and select the Jira service.
Select Enable integration.
Select Trigger actions. This determines whether a mention of a Jira issue in GitLab commits, merge requests, or both, should link the Jira issue back to that source commit/MR and transition the Jira issue, if indicated.
To include a comment on the Jira issue when the above reference is made in GitLab, select Enable comments.
- Select the Comment detail: Standard or All details.
Enter the further details on the page as described in the following table.
The base URL to the Jira instance web interface which is being linked to this GitLab project. For example,
Jira API URL
The base URL to the Jira instance API. Web URL value is used if not set. For example,
https://jira-api.example.com. Leave this field blank (or use the same value of
Web URL) if using Jira on Atlassian cloud.
Username or Email
Created in configure Jira step. Use
usernamefor Jira Server or
Created in configure Jira step. Use
passwordfor Jira Server or
API tokenfor Jira on Atlassian cloud.
Jira workflow transition IDs
Required for closing Jira issues via commits or merge requests. These are the IDs of transitions in Jira that move issues to a particular state. (See Obtaining a transition ID.) If you insert multiple transition IDs separated by
;, the issue is moved to each state, one after another, using the given order. In GitLab 13.6 and earlier, field was called
To enable users to view Jira issues inside the GitLab project, select Enable Jira issues and enter a Jira project key.
You can only display issues from a single Jira project within a given GitLab project.If you enable Jira issues with the setting above, all users that have access to this GitLab project are able to view all issues from the specified Jira project.
To enable creation of issues for vulnerabilities, select Enable Jira issues creation from vulnerabilities.
- Select the Jira issue type. If the dropdown is empty, select refresh () and try again.
To verify the Jira connection is working, select Test settings.
Select Save changes.
Your GitLab project can now interact with all Jira projects in your instance and the project now displays a Jira link that opens the Jira project.
In the most recent Jira user interface, you can no longer see transition IDs in the workflow administration UI. You can get the ID you need in either of the following ways:
- By using the API, with a request like
https://yourcompany.atlassian.net/rest/api/2/issue/ISSUE-123/transitionsusing an issue that is in the appropriate “open” state
- By mousing over the link for the transition you want and looking for the “action” parameter in the URL
Note that the transition ID may vary between workflows (for example, bug vs. story), even if the status you are changing to is the same.
You can continue to have GitLab cross-link a source commit/MR with a Jira issue while disabling the comment added to the issue.
See the Configure GitLab section and uncheck the Enable comments setting.
By now you should have configured Jira and enabled the Jira service in GitLab. If everything is set up correctly you should be able to reference and close Jira issues by just mentioning their ID in GitLab commits and merge requests.
Jira issue IDs must be formatted in uppercase for the integration to work.
When GitLab project has Jira issue tracker configured and enabled, mentioning
Jira issues in GitLab automatically adds a comment in Jira issue with the
link back to GitLab. This means that in comments in merge requests and commits
referencing an issue,
PROJECT-7 for example, adds a comment in Jira issue in the
USER mentioned this issue in RESOURCE_NAME of [PROJECT_NAME|LINK_TO_COMMENT]: ENTITY_TITLE
USERA user that mentioned the issue. This is the link to the user profile in GitLab.
LINK_TO_THE_COMMENTLink to the origin of mention with a name of the entity where Jira issue was mentioned.
RESOURCE_NAMEKind of resource which referenced the issue. Can be a commit or merge request.
PROJECT_NAMEGitLab project name.
ENTITY_TITLEMerge request title or commit message first line.
For example, the following commit references the Jira issue with
PROJECT-1 as its ID:
git commit -m "PROJECT-1 Fix spelling and grammar"
Jira issues can be closed directly from GitLab by using trigger words in commits and merge requests. When a commit which contains the trigger word followed by the Jira issue ID in the commit message is pushed, GitLab adds a comment in the mentioned Jira issue and immediately closes it (provided the transition ID was set up correctly).
There are currently three trigger words, and you can use either one to achieve the same goal:
PROJECT-1 is the ID of the Jira issue.
Note the following:
- Only commits and merges into the project’s default branch (usually
master) close an issue in Jira. You can change your project’s default branch under project settings.
- The Jira issue is not transitioned if it has a resolution.
Let’s consider the following example:
- For the project named
PROJECTin Jira, we implemented a new feature and created a merge request in GitLab.
- This feature was requested in Jira issue
PROJECT-7and the merge request in GitLab contains the improvement
- In the merge request description we use the issue closing trigger
- Once the merge request is merged, the Jira issue is automatically closed with a comment and an associated link to the commit that resolved the issue.
In the following screenshot you can see what the link references to the Jira issue look like.
Once this merge request is merged, the Jira issue is automatically closed with a link to the commit that resolved the issue.
You can browse and search issues from a selected Jira project directly in GitLab. This requires configuration in GitLab by an administrator.
From the Jira Issues menu, click Issues List. The issue list defaults to sort by Created date, with the newest issues listed at the top. You can change this to Last updated.
Issues are grouped into tabs based on their Jira status.
- The Open tab displays all issues with a Jira status in any category other than Done.
- The Closed tab displays all issues with a Jira status categorized as Done.
- The All tab displays all issues of any status.
Click an issue title to open its original Jira issue page for full details.
To refine the list of issues, use the search bar to search for any text contained in an issue summary (title) or description.
You can also filter by labels, status, reporter, and assignee using URL parameters. Enhancements to be able to use these through the user interface are planned.
To filter issues by
labels, specify one or more labels as part of the
labelsparameter in the URL. When using multiple labels, only issues that contain all specified labels are listed.
To filter issues by
status, specify the
statusparameter in the URL.
To filter issues by
reporter, specify a reporter’s Jira display name for the
author_usernameparameter in the URL.
To filter issues by
assignee, specify their Jira display name for the
assignee_usernameparameter in the URL.
If these features do not work as expected, it is likely due to a problem with the way the integration settings were configured.
Make sure that the Jira user you set up for the integration has the correct access permission to post comments on a Jira issue and also to transition the issue, if you’d like GitLab to also be able to do so. Jira issue references and update comments do not work if the GitLab issue tracker is disabled.
Make sure the
Transition ID you set within the Jira settings matches the one
your project needs to close an issue.
Make sure that the Jira issue is not already marked as resolved; that is, the Jira issue resolution field is not set. (It should not be struck through in Jira lists.)
CAPTCHA may be triggered after several consecutive failed login attempts
which may lead to a
401 unauthorized error when testing your Jira integration.
If CAPTCHA has been triggered, you can’t use Jira’s REST API to
authenticate with the Jira site. You need to log in to your Jira instance
and complete the CAPTCHA.