doc/integration/jira/issues.md
{{< details >}}
{{< /details >}}
You can manage Jira issues directly in GitLab. You can then refer to Jira issues by ID in GitLab commits and merge requests. The Jira issue IDs must be in uppercase.
With this integration, you can cross-reference Jira issues while you work in GitLab issues, merge requests, and Git. When you mention a Jira issue in a GitLab issue, merge request, comment, or commit:
For example, when this commit refers to a GIT-1 Jira issue:
git commit -m "GIT-1 this is a test commit"
GitLab adds to that Jira issue:
A reference in the Web links section.
A comment in the Activity section that follows this format:
USER mentioned this issue in RESOURCE_NAME of [PROJECT_NAME|COMMENTLINK]:
ENTITY_TITLE
USER: Name of the user who has mentioned the Jira issue with a link to their GitLab user profile.RESOURCE_NAME: Type of resource (for example, a GitLab commit, issue, or merge request) that has referenced the Jira issue.PROJECT_NAME: GitLab project name.COMMENTLINK: Link to where the Jira issue is mentioned.ENTITY_TITLE: Title of the GitLab commit (first line), issue, or merge request.Only a single cross-reference appears in Jira per GitLab issue, merge request, or commit. For example, multiple comments on a GitLab merge request that reference a Jira issue create only a single cross-reference back to that merge request in Jira.
You can disable comments on issues.
{{< details >}}
{{< /details >}}
With this integration, you can prevent merge requests from being merged if they do not refer to a Jira issue. To enable this feature:
After you enable this feature, a merge request that doesn't reference an associated Jira issue can't be merged. The merge request displays the message To merge, a Jira issue key must be mentioned in the title or description.
{{< history >}}
{{< /history >}}
You can configure custom rules for how GitLab matches Jira issue keys by defining:
When you do not configure custom rules, the default behavior is used.
{{< history >}}
{{< /history >}}
You can use a regular expression (regex) to match Jira issue keys. The regex pattern must follow the RE2 syntax.
To define a regex pattern for Jira issue keys:
For more information, see the Atlassian documentation.
{{< history >}}
{{< /history >}}
You can use a prefix to match Jira issue keys.
For example, if your Jira issue key is ALPHA-1 and you define a JIRA# prefix,
GitLab matches JIRA#ALPHA-1 rather than ALPHA-1.
To define a prefix for Jira issue keys:
If you have configured GitLab transition IDs, you can close a Jira issue directly from GitLab. Use a trigger word followed by a Jira issue ID in a commit or merge request. When you push a commit containing a trigger word and Jira issue ID, GitLab:
For example, use any of these trigger words to close the Jira issue PROJECT-1:
Resolves PROJECT-1Closes PROJECT-1Fixes PROJECT-1The commit or merge request must target your project's default branch. You can change your project's default branch in project settings.
When your branch name matches the Jira issue ID, Closes <JIRA-ID> is automatically appended to your existing merge request template.
If you do not want to close the issue, disable automatic issue closing.
Consider this example:
PROJECT-7 to request a new feature.Closes PROJECT-7.When you configure automatic issue transitions, you can transition a referenced Jira issue to the next available status with a category of Done. To configure this setting:
For advanced workflows, you can specify custom Jira transition IDs:
Use the method based on your Jira subscription status:
https://yourcompany.atlassian.net/rest/api/2/issue/ISSUE-123/transitions,
using an issue that is in the appropriate "open" state.The transition ID may vary between workflows (for example, a bug instead of a story), even if the status you're changing to is the same.
Refer to the Configure GitLab instructions.
Select the Enable Jira transitions setting.
Select the Custom transitions option.
Enter your transition IDs in the text field. If you insert multiple transition IDs
(separated by , or ;), the issue is moved to each state, one after another, in the
order you specify. If a transition fails, the sequence is aborted.
GitLab can cross-link source commits or merge requests with Jira issues without adding a comment to the Jira issue: