You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once you integrate your GitLab project with your Jira instance, you can automatically
12
+
detect and cross-reference activity between the GitLab project and any of your projects
13
+
in Jira. This includes the ability to close or transition Jira issues when the work
14
+
is completed in GitLab.
15
+
16
+
Here's how the integration responds when you take the following actions in GitLab:
17
+
18
+
-**Mention a Jira issue ID** in a commit message or MR (merge request).
19
+
- GitLab hyperlinks to the Jira issue.
20
+
- The Jira issue adds an issue link to the commit/MR in GitLab.
21
+
- The Jira issue adds a comment reflecting the comment made in GitLab, the comment author, and a link to the commit/MR in GitLab.
22
+
-**Mention that a commit or MR 'closes', 'resolves', or 'fixes' a Jira issue ID**. When the commit is made on master or the change is merged to master:
23
+
- GitLab's merge request page displays a note that it "Closed" the Jira issue, with a link to the issue. (Note: Before the merge, an MR will display that it "Closes" the Jira issue.)
24
+
- The Jira issue shows the activity and the Jira issue is closed, or otherwise transitioned.
25
+
26
+
You can also use [Jira's Smart Commits](https://confluence.atlassian.com/fisheye/using-smart-commits-298976812.html)
27
+
directly from GitLab, as covered in the article
28
+
[How and why to integrate GitLab with Jira](https://www.programmableweb.com/news/how-and-why-to-integrate-gitlab-Jira/how-to/2017/04/25).
10
29
11
30
## Configuration
12
31
13
-
Each GitLab project can be configured to connect to a different JIRA instance. That
14
-
means one GitLab project maps to _all_ JIRA projects in that JIRA instance once
15
-
the configuration is set up. Therefore, you don't have to explicitly associate
16
-
one GitLab project to any JIRA project. Once the configuration is set up, any JIRA
17
-
projects in the JIRA instance are already mapped to the GitLab project.
32
+
Each GitLab project can be configured to connect to an entire Jira instance. That
33
+
means one GitLab project can interact with _all_ Jira projects in that instance, once
34
+
configured. Therefore, you will not have to explicitly associate
35
+
a GitLab project with any single Jira project.
18
36
19
-
If you have one JIRA instance you can pre-fill the settings page with a default
20
-
template, see the [Services Templates][services-templates] docs.
37
+
If you have one Jira instance, you can pre-fill the settings page with a default
38
+
template. See the [Services Templates][services-templates] docs.
21
39
22
-
Configuration happens via user name and password. Connecting to a JIRA server
40
+
Configuration happens via user name and password. Connecting to a Jira server
23
41
via CAS is not possible.
24
42
25
-
In order to enable the JIRA service in GitLab, you need to first configure the
26
-
project in JIRA and then enter the correct values in GitLab.
43
+
In order to enable the Jira service in GitLab, you need to first configure the
44
+
project in Jira and then enter the correct values in GitLab.
27
45
28
-
### Configuring JIRA
46
+
### Configuring Jira
29
47
30
-
We need to create a user in JIRA which will have access to all projects that
31
-
need to integrate with GitLab. Login to your JIRA instance as admin and under
32
-
Administration go to User Management and create a new user.
48
+
We need to create a user in Jira which will have access to all projects that
49
+
need to integrate with GitLab. Login to your Jira instance as admin and under
50
+
*Administration*, go to *User Management* and create a new user.
33
51
34
-
As an example, we'll create a user named `gitlab` and add it to `JIRA-developers`
52
+
As an example, we'll create a user named `gitlab` and add it to the `Jira-developers`
35
53
group.
36
54
37
-
**It is important that the user `GitLab` has write-access to projects in JIRA**
55
+
**It is important that the user `gitlab` has 'write' access to projects in Jira**
38
56
39
57
We have split this stage in steps so it is easier to follow.
40
58
41
-
---
42
-
43
-
1. Login to your JIRA instance as an administrator and under **Administration**
59
+
1. Log in to your Jira instance as an administrator and under **Administration**
44
60
go to **User Management** to create a new user.
45
61
46
-

47
-
48
-
---
62
+

49
63
50
64
1. The next step is to create a new user (e.g., `gitlab`) who has write access
51
-
to projects in JIRA. Enter the user's name and a _valid_ e-mail address
52
-
since JIRA sends a verification e-mail to set up the password.
53
-
_**Note:** JIRA creates the username automatically by using the e-mail
54
-
prefix. You can change it later if you want._
65
+
to projects in Jira. Enter the user's name and a _valid_ e-mail address
66
+
since Jira sends a verification e-mail to set up the password.
67
+
_**Note:** Jira creates the username automatically by using the e-mail
68
+
prefix. You can change it later, if needed. Our integration does not support SSO (such as SAML). You will need to create
69
+
an HTTP basic authentication password. You can do this by visiting the user
70
+
profile, looking up the username, and setting a password._
55
71
56
-

57
-
58
-
---
72
+

59
73
60
74
1. Now, let's create a `gitlab-developers` group which will have write access
61
-
to projects in JIRA. Go to the **Groups** tab and select **Create group**.
62
-
63
-

64
-
65
-
---
66
-
67
-
Give it an optional description and hit **Create group**.
75
+
to projects in Jira. Go to the **Groups** tab and select **Create group**.
68
76
69
-

77
+

70
78
71
-
---
79
+
Give it an optional description and click **Create group**.
72
80
73
-
1. Give the newly-created group write access by going to
74
-
**Application access ➔ View configuration** and adding the `gitlab-developers`
75
-
group to JIRA Core.
81
+

76
82
77
-

83
+
1. To give the newly-created group 'write' access, go to
84
+
**Application access ➔ View configuration** and add the `gitlab-developers`
85
+
group to Jira Core.
78
86
79
-
---
87
+

80
88
81
89
1. Add the `gitlab` user to the `gitlab-developers` group by going to
82
90
**Users ➔ GitLab user ➔ Add group** and selecting the `gitlab-developers`
83
-
group from the dropdown menu. Notice that the group says _Access_ which is
84
-
what we aim for.
91
+
group from the dropdown menu. Notice that the group says _Access_, which is
92
+
intended as part of this process.
85
93
86
-

94
+

87
95
88
-
---
89
-
90
-
The JIRA configuration is over. Write down the new JIRA username and its
96
+
The Jira configuration is complete. Write down the new Jira username and its
91
97
password as they will be needed when configuring GitLab in the next section.
92
98
93
99
### Configuring GitLab
94
100
95
101
> **Notes:**
96
-
> - The currently supported JIRA versions are `v6.x` and `v7.x.`. GitLab 7.8 or
102
+
> - The currently supported Jira versions are `v6.x` and `v7.x.`. GitLab 7.8 or
97
103
> higher is required.
98
-
> - GitLab 8.14 introduced a new way to integrate with JIRA which greatly simplified
104
+
> - GitLab 8.14 introduced a new way to integrate with Jira which greatly simplified
99
105
> the configuration options you have to enter. If you are using an older version,
100
106
> [follow this documentation][jira-repo-old-docs].
101
107
> - In order to support Oracle's Access Manager, GitLab will send additional cookies
102
108
> to enable Basic Auth. The cookie being added to each request is `OBBasicAuth` with
103
109
> a value of `fromDialog`.
104
110
105
-
To enable JIRA integration in a project, navigate to the
111
+
To enable Jira integration in a project, navigate to the
the **JIRA** service, and fill in the required details on the page as described
113
+
the **Jira** service, and fill in the required details on the page as described
108
114
in the table below.
109
115
110
116
| Field | Description |
111
117
| ----- | ----------- |
112
-
|`Web URL`| The base URL to the JIRA instance web interface which is being linked to this GitLab project. E.g., `https://jira.example.com`. |
113
-
|`JIRA API URL`| The base URL to the JIRA instance API. Web URL value will be used if not set. E.g., `https://jira-api.example.com`. |
114
-
|`Username`| The user name created in [configuring JIRA step](#configuring-jira). Using the email address will cause `401 unauthorized`. |
115
-
|`Password`|The password of the user created in [configuring JIRA step](#configuring-jira). |
116
-
|`Transition ID`| This is the ID of a transition that moves issues to the desired state. It is possible to insert transition ids separated by `,` or `;` which means the issue will be moved to each state after another using the given order. **Closing JIRA issues via commits or Merge Requests won't work if you don't set the ID correctly.**|
118
+
|`Web URL`| The base URL to the Jira instance web interface which is being linked to this GitLab project. E.g., `https://Jira.example.com`. |
119
+
|`Jira API URL`| The base URL to the Jira instance API. Web URL value will be used if not set. E.g., `https://jira-api.example.com`. |
120
+
|`Username`| The user name created in [configuring Jira step](#configuring-jira). Using the email address will cause `401 unauthorized`. |
121
+
|`Password`|The password of the user created in [configuring Jira step](#configuring-jira). |
122
+
|`Transition ID`| This is the ID of a transition that moves issues to the desired state. It is possible to insert transition ids separated by `,` or `;` which means the issue will be moved to each state after another using the given order. **Closing Jira issues via commits or Merge Requests won't work if you don't set the ID correctly.**|
117
123
118
-
### Getting a transition ID
124
+
### Obtaining a transition ID
119
125
120
-
In the most recent JIRA UI, you can no longer see transition IDs in the workflow
126
+
In the most recent Jira user interface, you can no longer see transition IDs in the workflow
121
127
administration UI. You can get the ID you need in either of the following ways:
122
128
123
129
1. By using the API, with a request like `https://yourcompany.atlassian.net/rest/api/2/issue/ISSUE-123/transitions`
@@ -129,25 +135,23 @@ Note that the transition ID may vary between workflows (e.g., bug vs. story),
129
135
even if the status you are changing to is the same.
130
136
131
137
After saving the configuration, your GitLab project will be able to interact
132
-
with all JIRA projects in your JIRA instance and you'll see the JIRA link on the GitLab project pages that takes you to the appropriate JIRA project.
133
-
134
-

138
+
with all Jira projects in your Jira instance and you'll see the Jira link on the GitLab project pages that takes you to the appropriate Jira project.
135
139
136
-
---
140
+

137
141
138
-
## JIRA issues
142
+
## Jira issues
139
143
140
-
By now you should have [configured JIRA](#configuring-jira) and enabled the
141
-
[JIRA service in GitLab](#configuring-gitlab). If everything is set up correctly
142
-
you should be able to reference and close JIRA issues by just mentioning their
144
+
By now you should have [configured Jira](#configuring-jira) and enabled the
145
+
[Jira service in GitLab](#configuring-gitlab). If everything is set up correctly
146
+
you should be able to reference and close Jira issues by just mentioning their
143
147
ID in GitLab commits and merge requests.
144
148
145
-
### Referencing JIRA Issues
149
+
### Referencing Jira Issues
146
150
147
-
When GitLab project has JIRA issue tracker configured and enabled, mentioning
148
-
JIRA issue in GitLab will automatically add a comment in JIRA issue with the
151
+
When GitLab project has Jira issue tracker configured and enabled, mentioning
152
+
Jira issue in GitLab will automatically add a comment in Jira issue with the
149
153
link back to GitLab. This means that in comments in merge requests and commits
150
-
referencing an issue, e.g., `PROJECT-7`, will add a comment in JIRA issue in the
154
+
referencing an issue, e.g., `PROJECT-7`, will add a comment in Jira issue in the
151
155
format:
152
156
153
157
```
@@ -156,21 +160,19 @@ ENTITY_TITLE
156
160
```
157
161
158
162
*`USER` A user that mentioned the issue. This is the link to the user profile in GitLab.
159
-
*`LINK_TO_THE_COMMENT` Link to the origin of mention with a name of the entity where JIRA issue was mentioned.
163
+
*`LINK_TO_THE_COMMENT` Link to the origin of mention with a name of the entity where Jira issue was mentioned.
160
164
*`RESOURCE_NAME` Kind of resource which referenced the issue. Can be a commit or merge request.
161
165
*`PROJECT_NAME` GitLab project name.
162
166
*`ENTITY_TITLE` Merge request title or commit message first line.
163
167
164
-

168
+

165
169
166
-
---
170
+
### Closing Jira Issues
167
171
168
-
### Closing JIRA Issues
169
-
170
-
JIRA issues can be closed directly from GitLab by using trigger words in
172
+
Jira issues can be closed directly from GitLab by using trigger words in
171
173
commits and merge requests. When a commit which contains the trigger word
172
-
followed by the JIRA issue ID in the commit message is pushed, GitLab will
173
-
add a comment in the mentioned JIRA issue and immediately close it (provided
174
+
followed by the Jira issue ID in the commit message is pushed, GitLab will
175
+
add a comment in the mentioned Jira issue and immediately close it (provided
174
176
the transition ID was set up correctly).
175
177
176
178
There are currently three trigger words, and you can use either one to achieve
@@ -180,66 +182,66 @@ the same goal:
180
182
-`Closes PROJECT-1`
181
183
-`Fixes PROJECT-1`
182
184
183
-
where `PROJECT-1` is the issue ID of the JIRA project.
185
+
where `PROJECT-1` is the issue ID of the Jira project.
184
186
185
187
> **Notes:**
186
188
> - Only commits and merges into the project's default branch (usually **master**) will
187
189
> close an issue in Jira. You can change your projects default branch under
0 commit comments