issues.md 45.1 KB
Newer Older
1
# Issues API
Marin Jankovski's avatar
Marin Jankovski committed
2

3 4 5 6 7 8 9 10 11 12 13 14
Every API call to issues must be authenticated.

If a user is not a member of a project and the project is private, a `GET`
request on that project will result to a `404` status code.

## Issues pagination

By default, `GET` requests return 20 results at a time because the API results
are paginated.

Read more on [pagination](README.md#pagination).

Nihad Abbasov's avatar
Nihad Abbasov committed
15 16
## List issues

17 18 19
Get all issues the authenticated user has access to. By default it
returns only issues created by the current user. To get all issues,
use parameter `scope=all`.
Nihad Abbasov's avatar
Nihad Abbasov committed
20 21 22

```
GET /issues
jubianchi's avatar
jubianchi committed
23 24
GET /issues?state=opened
GET /issues?state=closed
jubianchi's avatar
jubianchi committed
25 26 27
GET /issues?labels=foo
GET /issues?labels=foo,bar
GET /issues?labels=foo,bar&state=opened
28 29
GET /issues?milestone=1.0.0
GET /issues?milestone=1.0.0&state=opened
30
GET /issues?iids[]=42&iids[]=43
31 32
GET /issues?author_id=5
GET /issues?assignee_id=5
33
GET /issues?my_reaction_emoji=star
Nihad Abbasov's avatar
Nihad Abbasov committed
34 35
```

36 37 38 39 40 41 42 43
| Attribute           | Type             | Required   | Description                                                                                                                                         |
| ------------------- | ---------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `state`             | string           | no         | Return all issues or just those that are `opened` or `closed`                                                                                       |
| `labels`            | string           | no         | Comma-separated list of label names, issues must have all labels to be returned. `No+Label` lists all issues with no labels                         |
| `milestone`         | string           | no         | The milestone title                                                                                                                                 |
| `scope`             | string           | no         | Return issues for the given scope: `created-by-me`, `assigned-to-me` or `all`. Defaults to `created-by-me` _([Introduced][ce-13004] in GitLab 9.5)_ |
| `author_id`         | integer          | no         | Return issues created by the given user `id`. Combine with `scope=all` or `scope=assigned-to-me`. _([Introduced][ce-13004] in GitLab 9.5)_          |
| `assignee_id`       | integer          | no         | Return issues assigned to the given user `id` _([Introduced][ce-13004] in GitLab 9.5)_                                                              |
Hiroyuki Sato's avatar
Hiroyuki Sato committed
44
| `my_reaction_emoji` | string           | no         | Return issues reacted by the authenticated user by the given `emoji` _([Introduced][ce-14016] in GitLab 10.0)_                                      |
45 46 47 48
| `iids[]`            | Array[integer]   | no         | Return only the issues having the given `iid`                                                                                                       |
| `order_by`          | string           | no         | Return issues ordered by `created_at` or `updated_at` fields. Default is `created_at`                                                               |
| `sort`              | string           | no         | Return issues sorted in `asc` or `desc` order. Default is `desc`                                                                                    |
| `search`            | string           | no         | Search issues against their `title` and `description`                                                                                               |
49 50

```bash
51
curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/issues
52
```
jubianchi's avatar
jubianchi committed
53

54
Example response:
jubianchi's avatar
jubianchi committed
55

Nihad Abbasov's avatar
Nihad Abbasov committed
56 57
```json
[
58 59 60 61 62 63
   {
      "state" : "opened",
      "description" : "Ratione dolores corrupti mollitia soluta quia.",
      "author" : {
         "state" : "active",
         "id" : 18,
64
         "web_url" : "https://gitlab.example.com/eileen.lowe",
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
         "name" : "Alexandra Bashirian",
         "avatar_url" : null,
         "username" : "eileen.lowe"
      },
      "milestone" : {
         "project_id" : 1,
         "description" : "Ducimus nam enim ex consequatur cumque ratione.",
         "state" : "closed",
         "due_date" : null,
         "iid" : 2,
         "created_at" : "2016-01-04T15:31:39.996Z",
         "title" : "v4.0",
         "id" : 17,
         "updated_at" : "2016-01-04T15:31:39.996Z"
      },
      "project_id" : 1,
81
      "assignees" : [{
82 83 84
         "state" : "active",
         "id" : 1,
         "name" : "Administrator",
85
         "web_url" : "https://gitlab.example.com/root",
86 87
         "avatar_url" : null,
         "username" : "root"
88
      }],
89 90 91 92 93 94 95 96
      "assignee" : {
         "state" : "active",
         "id" : 1,
         "name" : "Administrator",
         "web_url" : "https://gitlab.example.com/root",
         "avatar_url" : null,
         "username" : "root"
      },
97
      "updated_at" : "2016-01-04T15:31:51.081Z",
98
      "closed_at" : null,
99 100 101 102
      "id" : 76,
      "title" : "Consequatur vero maxime deserunt laboriosam est voluptas dolorem.",
      "created_at" : "2016-01-04T15:31:51.081Z",
      "iid" : 6,
103
      "labels" : [],
104
      "user_notes_count": 1,
105
      "due_date": "2016-07-22",
106
      "web_url": "http://example.com/example/example/issues/6",
107
      "confidential": false,
Lin Jen-Shin's avatar
Lin Jen-Shin committed
108
      "weight": null,
Jarka Kadlecova's avatar
Jarka Kadlecova committed
109
      "discussion_locked": false,
110 111 112 113 114 115
      "time_stats": {
         "time_estimate": 0,
         "total_time_spent": 0,
         "human_time_estimate": null,
         "human_total_time_spent": null
      },
116
   }
Nihad Abbasov's avatar
Nihad Abbasov committed
117 118 119
]
```

120
**Note**: `assignee` column is deprecated, now we show it as a single-sized array `assignees` to conform to the GitLab EE API.
121

122 123 124 125 126 127 128 129 130 131 132 133 134
## List group issues

Get a list of a group's issues.

```
GET /groups/:id/issues
GET /groups/:id/issues?state=opened
GET /groups/:id/issues?state=closed
GET /groups/:id/issues?labels=foo
GET /groups/:id/issues?labels=foo,bar
GET /groups/:id/issues?labels=foo,bar&state=opened
GET /groups/:id/issues?milestone=1.0.0
GET /groups/:id/issues?milestone=1.0.0&state=opened
135
GET /groups/:id/issues?iids[]=42&iids[]=43
136
GET /groups/:id/issues?search=issue+title+or+description
137 138
GET /groups/:id/issues?author_id=5
GET /groups/:id/issues?assignee_id=5
139
GET /groups/:id/issues?my_reaction_emoji=star
140 141
```

142 143 144 145 146 147 148 149 150 151
| Attribute           | Type             | Required   | Description                                                                                                                   |
| ------------------- | ---------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `id`                | integer/string   | yes        | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user                 |
| `state`             | string           | no         | Return all issues or just those that are `opened` or `closed`                                                                 |
| `labels`            | string           | no         | Comma-separated list of label names, issues must have all labels to be returned. `No+Label` lists all issues with no labels   |
| `iids[]`            | Array[integer]   | no         | Return only the issues having the given `iid`                                                                                 |
| `milestone`         | string           | no         | The milestone title                                                                                                           |
| `scope`             | string           | no         | Return issues for the given scope: `created-by-me`, `assigned-to-me` or `all` _([Introduced][ce-13004] in GitLab 9.5)_        |
| `author_id`         | integer          | no         | Return issues created by the given user `id` _([Introduced][ce-13004] in GitLab 9.5)_                                         |
| `assignee_id`       | integer          | no         | Return issues assigned to the given user `id` _([Introduced][ce-13004] in GitLab 9.5)_                                        |
Hiroyuki Sato's avatar
Hiroyuki Sato committed
152
| `my_reaction_emoji` | string           | no         | Return issues reacted by the authenticated user by the given `emoji` _([Introduced][ce-14016] in GitLab 10.0)_                |
153 154 155
| `order_by`          | string           | no         | Return issues ordered by `created_at` or `updated_at` fields. Default is `created_at`                                         |
| `sort`              | string           | no         | Return issues sorted in `asc` or `desc` order. Default is `desc`                                                              |
| `search`            | string           | no         | Search group issues against their `title` and `description`                                                                   |
156 157 158


```bash
159
curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/groups/4/issues
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
```

Example response:

```json
[
   {
      "project_id" : 4,
      "milestone" : {
         "due_date" : null,
         "project_id" : 4,
         "state" : "closed",
         "description" : "Rerum est voluptatem provident consequuntur molestias similique ipsum dolor.",
         "iid" : 3,
         "id" : 11,
         "title" : "v3.0",
         "created_at" : "2016-01-04T15:31:39.788Z",
         "updated_at" : "2016-01-04T15:31:39.788Z"
      },
      "author" : {
         "state" : "active",
181
         "web_url" : "https://gitlab.example.com/root",
182 183 184 185 186 187 188 189
         "avatar_url" : null,
         "username" : "root",
         "id" : 1,
         "name" : "Administrator"
      },
      "description" : "Omnis vero earum sunt corporis dolor et placeat.",
      "state" : "closed",
      "iid" : 1,
190
      "assignees" : [{
191
         "avatar_url" : null,
192
         "web_url" : "https://gitlab.example.com/lennie",
193 194 195 196
         "state" : "active",
         "username" : "lennie",
         "id" : 9,
         "name" : "Dr. Luella Kovacek"
197
      }],
198 199 200 201 202 203 204 205
      "assignee" : {
         "avatar_url" : null,
         "web_url" : "https://gitlab.example.com/lennie",
         "state" : "active",
         "username" : "lennie",
         "id" : 9,
         "name" : "Dr. Luella Kovacek"
      },
206 207 208 209 210
      "labels" : [],
      "id" : 41,
      "title" : "Ut commodi ullam eos dolores perferendis nihil sunt.",
      "updated_at" : "2016-01-04T15:31:46.176Z",
      "created_at" : "2016-01-04T15:31:46.176Z",
211
      "closed_at" : null,
212
      "user_notes_count": 1,
213
      "due_date": null,
214
      "web_url": "http://example.com/example/example/issues/1",
215
      "confidential": false,
Lin Jen-Shin's avatar
Lin Jen-Shin committed
216
      "weight": null,
Jarka Kadlecova's avatar
Jarka Kadlecova committed
217
      "discussion_locked": false,
218 219 220 221 222 223
      "time_stats": {
         "time_estimate": 0,
         "total_time_spent": 0,
         "human_time_estimate": null,
         "human_total_time_spent": null
      },
224 225 226 227
   }
]
```

228
**Note**: `assignee` column is deprecated, now we show it as a single-sized array `assignees` to conform to the GitLab EE API.
229

Nihad Abbasov's avatar
Nihad Abbasov committed
230 231
## List project issues

232
Get a list of a project's issues.
Nihad Abbasov's avatar
Nihad Abbasov committed
233 234 235

```
GET /projects/:id/issues
jubianchi's avatar
jubianchi committed
236 237
GET /projects/:id/issues?state=opened
GET /projects/:id/issues?state=closed
jubianchi's avatar
jubianchi committed
238 239 240
GET /projects/:id/issues?labels=foo
GET /projects/:id/issues?labels=foo,bar
GET /projects/:id/issues?labels=foo,bar&state=opened
241 242
GET /projects/:id/issues?milestone=1.0.0
GET /projects/:id/issues?milestone=1.0.0&state=opened
243
GET /projects/:id/issues?iids[]=42&iids[]=43
244
GET /projects/:id/issues?search=issue+title+or+description
245 246
GET /projects/:id/issues?author_id=5
GET /projects/:id/issues?assignee_id=5
247
GET /projects/:id/issues?my_reaction_emoji=star
Nihad Abbasov's avatar
Nihad Abbasov committed
248 249
```

250 251 252 253 254 255 256 257 258 259
| Attribute           | Type             | Required   | Description                                                                                                                   |
| ------------------- | ---------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `id`                | integer/string   | yes        | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user               |
| `iids[]`            | Array[integer]   | no         | Return only the milestone having the given `iid`                                                                              |
| `state`             | string           | no         | Return all issues or just those that are `opened` or `closed`                                                                 |
| `labels`            | string           | no         | Comma-separated list of label names, issues must have all labels to be returned. `No+Label` lists all issues with no labels   |
| `milestone`         | string           | no         | The milestone title                                                                                                           |
| `scope`             | string           | no         | Return issues for the given scope: `created-by-me`, `assigned-to-me` or `all` _([Introduced][ce-13004] in GitLab 9.5)_        |
| `author_id`         | integer          | no         | Return issues created by the given user `id` _([Introduced][ce-13004] in GitLab 9.5)_                                         |
| `assignee_id`       | integer          | no         | Return issues assigned to the given user `id` _([Introduced][ce-13004] in GitLab 9.5)_                                        |
Hiroyuki Sato's avatar
Hiroyuki Sato committed
260
| `my_reaction_emoji` | string           | no         | Return issues reacted by the authenticated user by the given `emoji` _([Introduced][ce-14016] in GitLab 10.0)_                |
261 262 263 264 265
| `order_by`          | string           | no         | Return issues ordered by `created_at` or `updated_at` fields. Default is `created_at`                                         |
| `sort`              | string           | no         | Return issues sorted in `asc` or `desc` order. Default is `desc`                                                              |
| `search`            | string           | no         | Search project issues against their `title` and `description`                                                                 |
| `created_after`     | datetime         | no         | Return issues created after the given time (inclusive)                                                                        |
| `created_before`    | datetime         | no         | Return issues created before the given time (inclusive)                                                                       |
266 267

```bash
268
curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/projects/4/issues
269 270 271
```

Example response:
Nihad Abbasov's avatar
Nihad Abbasov committed
272

273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289
```json
[
   {
      "project_id" : 4,
      "milestone" : {
         "due_date" : null,
         "project_id" : 4,
         "state" : "closed",
         "description" : "Rerum est voluptatem provident consequuntur molestias similique ipsum dolor.",
         "iid" : 3,
         "id" : 11,
         "title" : "v3.0",
         "created_at" : "2016-01-04T15:31:39.788Z",
         "updated_at" : "2016-01-04T15:31:39.788Z"
      },
      "author" : {
         "state" : "active",
290
         "web_url" : "https://gitlab.example.com/root",
291 292 293 294 295 296 297 298
         "avatar_url" : null,
         "username" : "root",
         "id" : 1,
         "name" : "Administrator"
      },
      "description" : "Omnis vero earum sunt corporis dolor et placeat.",
      "state" : "closed",
      "iid" : 1,
299
      "assignees" : [{
300
         "avatar_url" : null,
301
         "web_url" : "https://gitlab.example.com/lennie",
302 303 304 305
         "state" : "active",
         "username" : "lennie",
         "id" : 9,
         "name" : "Dr. Luella Kovacek"
306
      }],
307 308 309 310 311 312 313 314
      "assignee" : {
         "avatar_url" : null,
         "web_url" : "https://gitlab.example.com/lennie",
         "state" : "active",
         "username" : "lennie",
         "id" : 9,
         "name" : "Dr. Luella Kovacek"
      },
315 316 317 318
      "labels" : [],
      "id" : 41,
      "title" : "Ut commodi ullam eos dolores perferendis nihil sunt.",
      "updated_at" : "2016-01-04T15:31:46.176Z",
319
      "created_at" : "2016-01-04T15:31:46.176Z",
320
      "closed_at" : "2016-01-05T15:31:46.176Z",
321
      "user_notes_count": 1,
322
      "due_date": "2016-07-22",
323
      "web_url": "http://example.com/example/example/issues/1",
324
      "confidential": false,
Lin Jen-Shin's avatar
Lin Jen-Shin committed
325
      "weight": null,
Jarka Kadlecova's avatar
Jarka Kadlecova committed
326
      "discussion_locked": false,
327 328 329 330 331 332
      "time_stats": {
         "time_estimate": 0,
         "total_time_spent": 0,
         "human_time_estimate": null,
         "human_total_time_spent": null
      },
333 334 335
   }
]
```
336

337
**Note**: `assignee` column is deprecated, now we show it as a single-sized array `assignees` to conform to the GitLab EE API.
338

Nihad Abbasov's avatar
Nihad Abbasov committed
339 340
## Single issue

341
Get a single project issue.
Nihad Abbasov's avatar
Nihad Abbasov committed
342 343

```
344
GET /projects/:id/issues/:issue_iid
Nihad Abbasov's avatar
Nihad Abbasov committed
345 346
```

347
| Attribute   | Type    | Required | Description                          |
348
|-------------|---------|----------|--------------------------------------|
349
| `id`        | integer/string | yes      | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user  |
350
| `issue_iid` | integer | yes      | The internal ID of a project's issue |
Nihad Abbasov's avatar
Nihad Abbasov committed
351

352
```bash
353
curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/projects/4/issues/41
354 355 356
```

Example response:
Nihad Abbasov's avatar
Nihad Abbasov committed
357 358 359

```json
{
360 361 362 363 364 365 366 367 368 369
   "project_id" : 4,
   "milestone" : {
      "due_date" : null,
      "project_id" : 4,
      "state" : "closed",
      "description" : "Rerum est voluptatem provident consequuntur molestias similique ipsum dolor.",
      "iid" : 3,
      "id" : 11,
      "title" : "v3.0",
      "created_at" : "2016-01-04T15:31:39.788Z",
370 371
      "updated_at" : "2016-01-04T15:31:39.788Z",
      "closed_at" : "2016-01-05T15:31:46.176Z"
372 373 374
   },
   "author" : {
      "state" : "active",
375
      "web_url" : "https://gitlab.example.com/root",
376 377 378 379 380 381 382 383
      "avatar_url" : null,
      "username" : "root",
      "id" : 1,
      "name" : "Administrator"
   },
   "description" : "Omnis vero earum sunt corporis dolor et placeat.",
   "state" : "closed",
   "iid" : 1,
384
   "assignees" : [{
385
      "avatar_url" : null,
386
      "web_url" : "https://gitlab.example.com/lennie",
387 388 389 390
      "state" : "active",
      "username" : "lennie",
      "id" : 9,
      "name" : "Dr. Luella Kovacek"
391
   }],
392 393 394 395 396 397 398 399
   "assignee" : {
      "avatar_url" : null,
      "web_url" : "https://gitlab.example.com/lennie",
      "state" : "active",
      "username" : "lennie",
      "id" : 9,
      "name" : "Dr. Luella Kovacek"
   },
400 401 402 403
   "labels" : [],
   "id" : 41,
   "title" : "Ut commodi ullam eos dolores perferendis nihil sunt.",
   "updated_at" : "2016-01-04T15:31:46.176Z",
404
   "created_at" : "2016-01-04T15:31:46.176Z",
405
   "subscribed": false,
406
   "user_notes_count": 1,
407
   "due_date": null,
408
   "web_url": "http://example.com/example/example/issues/1",
409 410 411 412 413 414
   "time_stats": {
      "time_estimate": 0,
      "total_time_spent": 0,
      "human_time_estimate": null,
      "human_total_time_spent": null
   },
415
   "confidential": false,
Lin Jen-Shin's avatar
Lin Jen-Shin committed
416
   "weight": null,
417
   "discussion_locked": false,
418 419 420 421 422 423
   "_links": {
      "self": "http://example.com/api/v4/projects/1/issues/2",
      "notes": "http://example.com/api/v4/projects/1/issues/2/notes",
      "award_emoji": "http://example.com/api/v4/projects/1/issues/2/award_emoji",
      "project": "http://example.com/api/v4/projects/1"
   }
Nihad Abbasov's avatar
Nihad Abbasov committed
424 425 426
}
```

427
**Note**: `assignee` column is deprecated, now we show it as a single-sized array `assignees` to conform to the GitLab EE API.
428

Nihad Abbasov's avatar
Nihad Abbasov committed
429 430
## New issue

431
Creates a new project issue.
Nihad Abbasov's avatar
Nihad Abbasov committed
432 433 434 435 436

```
POST /projects/:id/issues
```

Valery Sizov's avatar
Valery Sizov committed
437 438
| Attribute                                 | Type           | Required | Description  |
|-------------------------------------------|----------------|----------|--------------|
439
| `id`                                      | integer/string | yes      | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
Valery Sizov's avatar
Valery Sizov committed
440 441 442 443 444 445 446 447 448 449 450
| `title`                                   | string         | yes      | The title of an issue |
| `description`                             | string         | no       | The description of an issue  |
| `confidential`                            | boolean        | no       | Set an issue to be confidential. Default is `false`.  |
| `assignee_ids`                            | Array[integer] | no       | The ID of a user to assign issue |
| `milestone_id`                            | integer        | no       | The ID of a milestone to assign issue  |
| `labels`                                  | string         | no       | Comma-separated label names for an issue  |
| `created_at`                              | string         | no       | Date time string, ISO 8601 formatted, e.g. `2016-03-11T03:45:40Z` (requires admin or project owner rights) |
| `due_date`                                | string         | no       | Date time string in the format YEAR-MONTH-DAY, e.g. `2016-03-11` |
| `merge_request_to_resolve_discussions_of` | integer        | no       | The IID of a merge request in which to resolve all issues. This will fill the issue with a default description and mark all discussions as resolved. When passing a description or title, these values will take precedence over the default values.|
| `discussion_to_resolve`                   | string         | no       | The ID of a discussion to resolve. This will fill in the issue with a default description and mark the discussion as resolved. Use in combination with `merge_request_to_resolve_discussions_of`. |
| `weight` | integer                                         | no | The weight of the issue in range 0 to 9 |
451 452

```bash
453
curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/projects/4/issues?title=Issues%20with%20auth&labels=bug
454
```
Nihad Abbasov's avatar
Nihad Abbasov committed
455

456
Example response:
Nihad Abbasov's avatar
Nihad Abbasov committed
457

458 459 460 461 462 463 464 465
```json
{
   "project_id" : 4,
   "id" : 84,
   "created_at" : "2016-01-07T12:44:33.959Z",
   "iid" : 14,
   "title" : "Issues with auth",
   "state" : "opened",
466
   "assignees" : [],
467
   "assignee" : null,
468 469 470 471 472 473 474
   "labels" : [
      "bug"
   ],
   "author" : {
      "name" : "Alexandra Bashirian",
      "avatar_url" : null,
      "state" : "active",
475
      "web_url" : "https://gitlab.example.com/eileen.lowe",
476 477 478 479 480
      "id" : 18,
      "username" : "eileen.lowe"
   },
   "description" : null,
   "updated_at" : "2016-01-07T12:44:33.959Z",
481
   "closed_at" : null,
482
   "milestone" : null,
483
   "subscribed" : true,
484
   "user_notes_count": 0,
485
   "due_date": null,
486
   "web_url": "http://example.com/example/example/issues/14",
487 488 489 490 491 492
   "time_stats": {
      "time_estimate": 0,
      "total_time_spent": 0,
      "human_time_estimate": null,
      "human_total_time_spent": null
   },
493
   "confidential": false,
Lin Jen-Shin's avatar
Lin Jen-Shin committed
494
   "weight": null,
495
   "discussion_locked": false,
496 497 498 499 500 501
   "_links": {
      "self": "http://example.com/api/v4/projects/1/issues/2",
      "notes": "http://example.com/api/v4/projects/1/issues/2/notes",
      "award_emoji": "http://example.com/api/v4/projects/1/issues/2/award_emoji",
      "project": "http://example.com/api/v4/projects/1"
   }
502 503
}
```
504

505
**Note**: `assignee` column is deprecated, now we show it as a single-sized array `assignees` to conform to the GitLab EE API.
506

Nihad Abbasov's avatar
Nihad Abbasov committed
507 508
## Edit issue

509 510 511
Updates an existing project issue. This call is also used to mark an issue as
closed.

Nihad Abbasov's avatar
Nihad Abbasov committed
512
```
513
PUT /projects/:id/issues/:issue_iid
Nihad Abbasov's avatar
Nihad Abbasov committed
514 515
```

516
| Attribute      | Type    | Required | Description                                                                                                |
517
|----------------|---------|----------|------------------------------------------------------------------------------------------------------------|
518
| `id`           | integer/string | yes      | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
519 520 521 522
| `issue_iid`    | integer | yes      | The internal ID of a project's issue                                                                       |
| `title`        | string  | no       | The title of an issue                                                                                      |
| `description`  | string  | no       | The description of an issue                                                                                |
| `confidential` | boolean | no       | Updates an issue to be confidential                                                                        |
523
| `assignee_ids`  | Array[integer] | no       | The ID of the users to assign the issue to                                                                    |
524 525 526 527 528
| `milestone_id` | integer | no       | The ID of a milestone to assign the issue to                                                               |
| `labels`       | string  | no       | Comma-separated label names for an issue                                                                   |
| `state_event`  | string  | no       | The state event of an issue. Set `close` to close the issue and `reopen` to reopen it                      |
| `updated_at`   | string  | no       | Date time string, ISO 8601 formatted, e.g. `2016-03-11T03:45:40Z` (requires admin or project owner rights) |
| `due_date`     | string  | no       | Date time string in the format YEAR-MONTH-DAY, e.g. `2016-03-11`                                           |
Nick Thomas's avatar
Nick Thomas committed
529
| `weight`       | integer | no       | The weight of the issue in range 0 to 9                                                                    |
530
| `discussion_locked` | boolean | no  | Flag indicating if the issue's discussion is locked. If the discussion is locked only project members can add or edit comments. |
531 532

```bash
533
curl --request PUT --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/projects/4/issues/85?state_event=close
534
```
Nihad Abbasov's avatar
Nihad Abbasov committed
535

536
Example response:
537

538 539 540 541 542 543 544 545 546
```json
{
   "created_at" : "2016-01-07T12:46:01.410Z",
   "author" : {
      "name" : "Alexandra Bashirian",
      "avatar_url" : null,
      "username" : "eileen.lowe",
      "id" : 18,
      "state" : "active",
547
      "web_url" : "https://gitlab.example.com/eileen.lowe"
548 549 550 551 552 553
   },
   "state" : "closed",
   "title" : "Issues with auth",
   "project_id" : 4,
   "description" : null,
   "updated_at" : "2016-01-07T12:55:16.213Z",
554
   "closed_at" : "2016-01-08T12:55:16.213Z",
555 556 557 558 559
   "iid" : 15,
   "labels" : [
      "bug"
   ],
   "id" : 85,
560
   "assignees" : [],
561
   "assignee" : null,
562
   "milestone" : null,
563
   "subscribed" : true,
564
   "user_notes_count": 0,
565
   "due_date": "2016-07-22",
566
   "web_url": "http://example.com/example/example/issues/15",
567 568 569 570 571 572
   "time_stats": {
      "time_estimate": 0,
      "total_time_spent": 0,
      "human_time_estimate": null,
      "human_total_time_spent": null
   },
573
   "confidential": false,
Lin Jen-Shin's avatar
Lin Jen-Shin committed
574
   "weight": null,
575
   "discussion_locked": false,
576 577 578 579 580 581
   "_links": {
      "self": "http://example.com/api/v4/projects/1/issues/2",
      "notes": "http://example.com/api/v4/projects/1/issues/2/notes",
      "award_emoji": "http://example.com/api/v4/projects/1/issues/2/award_emoji",
      "project": "http://example.com/api/v4/projects/1"
   }
582 583
}
```
584

585
**Note**: `assignee` column is deprecated, now we show it as a single-sized array `assignees` to conform to the GitLab EE API.
586

587
## Delete an issue
588

589
Only for admins and project owners. Soft deletes the issue in question.
590 591

```
592
DELETE /projects/:id/issues/:issue_iid
593 594
```

595
| Attribute   | Type    | Required | Description                          |
596
|-------------|---------|----------|--------------------------------------|
597
| `id`        | integer/string | yes      | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user  |
598
| `issue_iid` | integer | yes      | The internal ID of a project's issue |
599 600

```bash
601
curl --request DELETE --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/projects/4/issues/85
602 603
```

604 605
## Move an issue

606
Moves an issue to a different project. If the target project
607 608
equals the source project or the user has insufficient permissions to move an
issue, error `400` together with an explaining error message is returned.
609

610 611 612
If a given label and/or milestone with the same name also exists in the target
project, it will then be assigned to the issue that is being moved.

613
```
614
POST /projects/:id/issues/:issue_iid/move
615 616
```

617
| Attribute       | Type    | Required | Description                          |
618
|-----------------|---------|----------|--------------------------------------|
619
| `id`            | integer/string | yes      | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user  |
620 621
| `issue_iid`     | integer | yes      | The internal ID of a project's issue |
| `to_project_id` | integer | yes      | The ID of the new project            |
622 623

```bash
624
curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" --data '{"to_project_id": 5}' https://gitlab.example.com/api/v4/projects/4/issues/85/move
625 626 627 628 629 630 631 632 633 634 635 636 637 638
```

Example response:

```json
{
  "id": 92,
  "iid": 11,
  "project_id": 5,
  "title": "Sit voluptas tempora quisquam aut doloribus et.",
  "description": "Repellat voluptas quibusdam voluptatem exercitationem.",
  "state": "opened",
  "created_at": "2016-04-05T21:41:45.652Z",
  "updated_at": "2016-04-07T12:20:17.596Z",
639
  "closed_at": null,
640 641
  "labels": [],
  "milestone": null,
642
  "assignees": [{
643 644 645 646 647
    "name": "Miss Monserrate Beier",
    "username": "axel.block",
    "id": 12,
    "state": "active",
    "avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon",
648
    "web_url": "https://gitlab.example.com/axel.block"
649
  }],
650 651 652 653 654 655 656 657
  "assignee": {
    "name": "Miss Monserrate Beier",
    "username": "axel.block",
    "id": 12,
    "state": "active",
    "avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon",
    "web_url": "https://gitlab.example.com/axel.block"
  },
658 659 660 661 662 663
  "author": {
    "name": "Kris Steuber",
    "username": "solon.cremin",
    "id": 10,
    "state": "active",
    "avatar_url": "http://www.gravatar.com/avatar/7a190fecbaa68212a4b68aeb6e3acd10?s=80&d=identicon",
664
    "web_url": "https://gitlab.example.com/solon.cremin"
665
  },
666
  "due_date": null,
667
  "web_url": "http://example.com/example/example/issues/11",
668 669 670 671 672 673
  "time_stats": {
    "time_estimate": 0,
    "total_time_spent": 0,
    "human_time_estimate": null,
    "human_total_time_spent": null
  },
674
  "confidential": false,
Lin Jen-Shin's avatar
Lin Jen-Shin committed
675
  "weight": null,
676
  "discussion_locked": false,
677 678 679 680 681 682
  "_links": {
    "self": "http://example.com/api/v4/projects/1/issues/2",
    "notes": "http://example.com/api/v4/projects/1/issues/2/notes",
    "award_emoji": "http://example.com/api/v4/projects/1/issues/2/award_emoji",
    "project": "http://example.com/api/v4/projects/1"
  }
683 684 685
}
```

686
**Note**: `assignee` column is deprecated, now we show it as a single-sized array `assignees` to conform to the GitLab EE API.
687

688 689
## Subscribe to an issue

690
Subscribes the authenticated user to an issue to receive notifications.
691 692
If the user is already subscribed to the issue, the status code `304`
is returned.
693 694

```
695
POST /projects/:id/issues/:issue_iid/subscribe
696 697
```

698
| Attribute   | Type    | Required | Description                          |
699
|-------------|---------|----------|--------------------------------------|
700
| `id`        | integer/string | yes      | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user  |
701
| `issue_iid` | integer | yes      | The internal ID of a project's issue |
702 703

```bash
704
curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/projects/5/issues/93/subscribe
705 706 707 708 709 710 711 712 713 714 715 716 717 718
```

Example response:

```json
{
  "id": 92,
  "iid": 11,
  "project_id": 5,
  "title": "Sit voluptas tempora quisquam aut doloribus et.",
  "description": "Repellat voluptas quibusdam voluptatem exercitationem.",
  "state": "opened",
  "created_at": "2016-04-05T21:41:45.652Z",
  "updated_at": "2016-04-07T12:20:17.596Z",
719
  "closed_at": null,
720 721
  "labels": [],
  "milestone": null,
722
  "assignees": [{
723 724 725 726 727
    "name": "Miss Monserrate Beier",
    "username": "axel.block",
    "id": 12,
    "state": "active",
    "avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon",
728
    "web_url": "https://gitlab.example.com/axel.block"
729
  }],
730 731 732 733 734 735 736 737
  "assignee": {
    "name": "Miss Monserrate Beier",
    "username": "axel.block",
    "id": 12,
    "state": "active",
    "avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon",
    "web_url": "https://gitlab.example.com/axel.block"
  },
738 739 740 741 742 743
  "author": {
    "name": "Kris Steuber",
    "username": "solon.cremin",
    "id": 10,
    "state": "active",
    "avatar_url": "http://www.gravatar.com/avatar/7a190fecbaa68212a4b68aeb6e3acd10?s=80&d=identicon",
744
    "web_url": "https://gitlab.example.com/solon.cremin"
745
  },
746
  "due_date": null,
747
  "web_url": "http://example.com/example/example/issues/11",
748 749 750 751 752 753
  "time_stats": {
    "time_estimate": 0,
    "total_time_spent": 0,
    "human_time_estimate": null,
    "human_total_time_spent": null
  },
754
  "confidential": false,
Lin Jen-Shin's avatar
Lin Jen-Shin committed
755
  "weight": null,
756
  "discussion_locked": false,
757 758 759 760 761 762
  "_links": {
    "self": "http://example.com/api/v4/projects/1/issues/2",
    "notes": "http://example.com/api/v4/projects/1/issues/2/notes",
    "award_emoji": "http://example.com/api/v4/projects/1/issues/2/award_emoji",
    "project": "http://example.com/api/v4/projects/1"
  }
763 764 765
}
```

766
**Note**: `assignee` column is deprecated, now we show it as a single-sized array `assignees` to conform to the GitLab EE API.
767

768 769
## Unsubscribe from an issue

770
Unsubscribes the authenticated user from the issue to not receive notifications
771 772
from it. If the user is not subscribed to the issue, the
status code `304` is returned.
773 774

```
775
POST /projects/:id/issues/:issue_iid/unsubscribe
776 777
```

778
| Attribute   | Type    | Required | Description                          |
779
|-------------|---------|----------|--------------------------------------|
780
| `id`        | integer/string | yes      | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user  |
781
| `issue_iid` | integer | yes      | The internal ID of a project's issue |
782 783

```bash
784
curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/projects/5/issues/93/unsubscribe
785 786
```

787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824
Example response:

```json
{
  "id": 93,
  "iid": 12,
  "project_id": 5,
  "title": "Incidunt et rerum ea expedita iure quibusdam.",
  "description": "Et cumque architecto sed aut ipsam.",
  "state": "opened",
  "created_at": "2016-04-05T21:41:45.217Z",
  "updated_at": "2016-04-07T13:02:37.905Z",
  "labels": [],
  "milestone": null,
  "assignee": {
    "name": "Edwardo Grady",
    "username": "keyon",
    "id": 21,
    "state": "active",
    "avatar_url": "http://www.gravatar.com/avatar/3e6f06a86cf27fa8b56f3f74f7615987?s=80&d=identicon",
    "web_url": "https://gitlab.example.com/keyon"
  },
  "author": {
    "name": "Vivian Hermann",
    "username": "orville",
    "id": 11,
    "state": "active",
    "avatar_url": "http://www.gravatar.com/avatar/5224fd70153710e92fb8bcf79ac29d67?s=80&d=identicon",
    "web_url": "https://gitlab.example.com/orville"
  },
  "subscribed": false,
  "due_date": null,
  "web_url": "http://example.com/example/example/issues/12",
  "confidential": false,
  "discussion_locked": false
}
```

825 826
## Create a todo

827
Manually creates a todo for the current user on an issue. If
828 829 830 831
there already exists a todo for the user on that issue, status code `304` is
returned.

```
832
POST /projects/:id/issues/:issue_iid/todo
833 834
```

835
| Attribute   | Type    | Required | Description                          |
836
|-------------|---------|----------|--------------------------------------|
837
| `id`        | integer/string | yes      | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user  |
838
| `issue_iid` | integer | yes      | The internal ID of a project's issue |
839 840

```bash
841
curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/projects/5/issues/93/todo
842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861
```

Example response:

```json
{
  "id": 112,
  "project": {
    "id": 5,
    "name": "Gitlab Ci",
    "name_with_namespace": "Gitlab Org / Gitlab Ci",
    "path": "gitlab-ci",
    "path_with_namespace": "gitlab-org/gitlab-ci"
  },
  "author": {
    "name": "Administrator",
    "username": "root",
    "id": 1,
    "state": "active",
    "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
862
    "web_url": "https://gitlab.example.com/root"
863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886
  },
  "action_name": "marked",
  "target_type": "Issue",
  "target": {
    "id": 93,
    "iid": 10,
    "project_id": 5,
    "title": "Vel voluptas atque dicta mollitia adipisci qui at.",
    "description": "Tempora laboriosam sint magni sed voluptas similique.",
    "state": "closed",
    "created_at": "2016-06-17T07:47:39.486Z",
    "updated_at": "2016-07-01T11:09:13.998Z",
    "labels": [],
    "milestone": {
      "id": 26,
      "iid": 1,
      "project_id": 5,
      "title": "v0.0",
      "description": "Accusantium nostrum rerum quae quia quis nesciunt suscipit id.",
      "state": "closed",
      "created_at": "2016-06-17T07:47:33.832Z",
      "updated_at": "2016-06-17T07:47:33.832Z",
      "due_date": null
    },
887
    "assignees": [{
888 889 890 891 892
      "name": "Jarret O'Keefe",
      "username": "francisca",
      "id": 14,
      "state": "active",
      "avatar_url": "http://www.gravatar.com/avatar/a7fa515d53450023c83d62986d0658a8?s=80&d=identicon",
893
      "web_url": "https://gitlab.example.com/francisca"
894
    }],
895 896 897 898 899 900 901 902
    "assignee": {
      "name": "Jarret O'Keefe",
      "username": "francisca",
      "id": 14,
      "state": "active",
      "avatar_url": "http://www.gravatar.com/avatar/a7fa515d53450023c83d62986d0658a8?s=80&d=identicon",
      "web_url": "https://gitlab.example.com/francisca"
    },
903 904 905 906 907 908
    "author": {
      "name": "Maxie Medhurst",
      "username": "craig_rutherford",
      "id": 12,
      "state": "active",
      "avatar_url": "http://www.gravatar.com/avatar/a0d477b3ea21970ce6ffcbb817b0b435?s=80&d=identicon",
909
      "web_url": "https://gitlab.example.com/craig_rutherford"
910 911 912 913
    },
    "subscribed": true,
    "user_notes_count": 7,
    "upvotes": 0,
914 915
    "downvotes": 0,
    "due_date": null,
916
    "web_url": "http://example.com/example/example/issues/110",
917
    "confidential": false,
Jarka Kadlecova's avatar
Jarka Kadlecova committed
918
    "weight": null,
919
    "discussion_locked": false
920 921 922 923 924 925 926 927
  },
  "target_url": "https://gitlab.example.com/gitlab-org/gitlab-ci/issues/10",
  "body": "Vel voluptas atque dicta mollitia adipisci qui at.",
  "state": "pending",
  "created_at": "2016-07-01T11:09:13.992Z"
}
```

928
**Note**: `assignee` column is deprecated, now we show it as a single-sized array `assignees` to conform to the GitLab EE API.
929

930 931 932 933 934
## Set a time estimate for an issue

Sets an estimated time of work for this issue.

```
935
POST /projects/:id/issues/:issue_iid/time_estimate
936 937
```

938
| Attribute   | Type    | Required | Description                              |
939
|-------------|---------|----------|------------------------------------------|
940
| `id`        | integer/string | yes      | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user      |
941 942
| `issue_iid` | integer | yes      | The internal ID of a project's issue     |
| `duration`  | string  | yes      | The duration in human format. e.g: 3h30m |
943 944

```bash
945
curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/projects/5/issues/93/time_estimate?duration=3h30m
946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963
```

Example response:

```json
{
  "human_time_estimate": "3h 30m",
  "human_total_time_spent": null,
  "time_estimate": 12600,
  "total_time_spent": 0
}
```

## Reset the time estimate for an issue

Resets the estimated time for this issue to 0 seconds.

```
964
POST /projects/:id/issues/:issue_iid/reset_time_estimate
965 966
```

967
| Attribute   | Type    | Required | Description                          |
968
|-------------|---------|----------|--------------------------------------|
969
| `id`        | integer/string | yes      | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user  |
970
| `issue_iid` | integer | yes      | The internal ID of a project's issue |
971 972

```bash
973
curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/projects/5/issues/93/reset_time_estimate
974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991
```

Example response:

```json
{
  "human_time_estimate": null,
  "human_total_time_spent": null,
  "time_estimate": 0,
  "total_time_spent": 0
}
```

## Add spent time for an issue

Adds spent time for this issue

```
992
POST /projects/:id/issues/:issue_iid/add_spent_time
993 994
```

995
| Attribute   | Type    | Required | Description                              |
996
|-------------|---------|----------|------------------------------------------|
997
| `id`        | integer/string | yes      | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user      |
998 999
| `issue_iid` | integer | yes      | The internal ID of a project's issue     |
| `duration`  | string  | yes      | The duration in human format. e.g: 3h30m |
1000 1001

```bash
1002
curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/projects/5/issues/93/add_spent_time?duration=1h
1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020
```

Example response:

```json
{
  "human_time_estimate": null,
  "human_total_time_spent": "1h",
  "time_estimate": 0,
  "total_time_spent": 3600
}
```

## Reset spent time for an issue

Resets the total spent time for this issue to 0 seconds.

```
1021
POST /projects/:id/issues/:issue_iid/reset_spent_time
1022 1023
```

1024
| Attribute   | Type    | Required | Description                          |
1025
|-------------|---------|----------|--------------------------------------|
1026
| `id`        | integer/string | yes      | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
1027
| `issue_iid` | integer | yes      | The internal ID of a project's issue |
1028 1029

```bash
1030
curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/projects/5/issues/93/reset_spent_time
1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046
```

Example response:

```json
{
  "human_time_estimate": null,
  "human_total_time_spent": null,
  "time_estimate": 0,
  "total_time_spent": 0
}
```

## Get time tracking stats

```
1047
GET /projects/:id/issues/:issue_iid/time_stats
1048 1049
```

1050
| Attribute   | Type    | Required | Description                          |
1051
|-------------|---------|----------|--------------------------------------|
1052
| `id`        | integer/string | yes      | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user  |
1053
| `issue_iid` | integer | yes      | The internal ID of a project's issue |
1054 1055

```bash
1056
curl --request GET --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/projects/5/issues/93/time_stats
1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069
```

Example response:

```json
{
  "human_time_estimate": "2h",
  "human_total_time_spent": "1h",
  "time_estimate": 7200,
  "total_time_spent": 3600
}
```

1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124
## List merge requests that will close issue on merge

Get all the merge requests that will close issue when merged.

```
GET /projects/:id/issues/:issue_iid/closed_by
```

| Attribute   | Type    | Required | Description                          |
| ---------   | ----    | -------- | -----------                          |
| `id`        | integer | yes      | The ID of a project                  |
| `issue_iid` | integer | yes      | The internal ID of a project issue   |

```bash
curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/projects/1/issues/11/closed_by
```

Example response:

```json
[
  {
    "id": 6471,
    "iid": 6432,
    "project_id": 1,
    "title": "add a test for cgi lexer options",
    "description": "closes #11",
    "state": "opened",
    "created_at": "2017-04-06T18:33:34.168Z",
    "updated_at": "2017-04-09T20:10:24.983Z",
    "target_branch": "master",
    "source_branch": "feature.custom-highlighting",
    "upvotes": 0,
    "downvotes": 0,
    "author": {
      "name": "Administrator",
      "username": "root",
      "id": 1,
      "state": "active",
      "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
      "web_url": "https://gitlab.example.com/root"
    },
    "assignee": null,
    "source_project_id": 1,
    "target_project_id": 1,
    "labels": [],
    "work_in_progress": false,
    "milestone": null,
    "merge_when_pipeline_succeeds": false,
    "merge_status": "unchecked",
    "sha": "5a62481d563af92b8e32d735f2fa63b94e806835",
    "merge_commit_sha": null,
    "user_notes_count": 1,
    "should_remove_source_branch": null,
    "force_remove_source_branch": false,
1125 1126 1127 1128 1129 1130 1131
    "web_url": "https://gitlab.example.com/gitlab-org/gitlab-test/merge_requests/6432",
    "time_stats": {
      "time_estimate": 0,
      "total_time_spent": 0,
      "human_time_estimate": null,
      "human_total_time_spent": null
    }
1132 1133 1134 1135 1136
  }
]
```


1137 1138
## Comments on issues

1139
Comments are done via the [notes](notes.md) resource.
James Lopez's avatar
James Lopez committed
1140 1141 1142

## Get user agent details

James Lopez's avatar
James Lopez committed
1143 1144
Available only for admins.

James Lopez's avatar
James Lopez committed
1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163
```
GET /projects/:id/issues/:issue_iid/user_agent_detail
```

| Attribute   | Type    | Required | Description                          |
|-------------|---------|----------|--------------------------------------|
| `id`        | integer/string | yes      | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user  |
| `issue_iid` | integer | yes      | The internal ID of a project's issue |

```bash
curl --request GET --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/projects/5/issues/93/user_agent_detail
```

Example response:

```json
{
  "user_agent": "AppleWebKit/537.36",
  "ip_address": "127.0.0.1",
1164
  "akismet_submitted": false
James Lopez's avatar
James Lopez committed
1165 1166
}
```
1167 1168

[ce-13004]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/13004
Hiroyuki Sato's avatar
Hiroyuki Sato committed
1169
[ce-14016]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14016