2020-05-26 23:08:26 -04:00
---
stage: Plan
group: Project Management
2020-11-26 01:09:20 -05:00
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
2020-05-26 23:08:26 -04:00
---
2021-06-23 11:07:50 -04:00
# Issues API **(FREE)**
Interact with [GitLab Issues ](../user/project/issues/index.md ) using the REST API.
2014-05-27 08:12:15 -04:00
2020-12-17 19:10:04 -05:00
If a user is not a member of a private project, a `GET`
2020-08-20 23:10:16 -04:00
request on that project results in a `404` status code.
2016-01-18 03:10:46 -05:00
## Issues pagination
By default, `GET` requests return 20 results at a time because the API results
are paginated.
2021-06-28 11:08:03 -04:00
Read more on [pagination ](index.md#pagination ).
2016-01-18 03:10:46 -05:00
2020-12-07 19:09:45 -05:00
WARNING:
2020-08-20 23:10:16 -04:00
The `reference` attribute in responses is deprecated in favor of `references` .
2021-09-15 20:11:46 -04:00
[Introduced ](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/20354 ) in GitLab 12.6.
2019-12-27 10:08:16 -05:00
2020-12-04 16:09:29 -05:00
NOTE:
2020-08-20 23:10:16 -04:00
The `references.relative` attribute is relative to the group or project of the issue being requested.
2020-12-17 19:10:04 -05:00
When an issue is fetched from its project, the `relative` format is the same as the `short` format.
When requested across groups or projects, it's expected to be the same as the `full` format.
2019-12-27 10:08:16 -05:00
2012-07-24 08:25:01 -04:00
## List issues
2021-05-18 20:10:43 -04:00
> The `weight` property moved to GitLab Premium in 13.9.
2021-05-04 08:10:04 -04:00
2017-07-27 18:08:44 -04:00
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` .
2012-07-24 08:25:01 -04:00
2020-02-27 04:09:01 -05:00
```plaintext
2012-07-24 08:25:01 -04:00
GET /issues
2020-09-30 20:10:16 -04:00
GET /issues?assignee_id=5
GET /issues?author_id=5
GET /issues?confidential=true
GET /issues?iids[]=42& iids[]=43
2014-08-14 10:17:19 -04:00
GET /issues?labels=foo
GET /issues?labels=foo,bar
GET /issues?labels=foo,bar& state=opened
2016-10-26 04:08:58 -04:00
GET /issues?milestone=1.0.0
GET /issues?milestone=1.0.0& state=opened
2017-09-03 03:34:50 -04:00
GET /issues?my_reaction_emoji=star
2019-01-13 11:24:31 -05:00
GET /issues?search=foo& in=title
2020-09-30 20:10:16 -04:00
GET /issues?state=closed
GET /issues?state=opened
2012-07-24 08:25:01 -04:00
```
2017-09-03 03:34:50 -04:00
| Attribute | Type | Required | Description |
| ------------------- | ---------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
2020-08-20 23:10:16 -04:00
| `assignee_id` | integer | no | Return issues assigned to the given user `id` . Mutually exclusive with `assignee_username` . `None` returns unassigned issues. `Any` returns issues with an assignee. _([Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/13004) in GitLab 9.5)_ |
| `assignee_username` | string array | no | Return issues assigned to the given `username` . Similar to `assignee_id` and mutually exclusive with `assignee_id` . In GitLab CE, the `assignee_username` array should only contain a single value. Otherwise, an invalid parameter error is returned. |
2020-03-31 23:07:57 -04:00
| `author_id` | integer | no | Return issues created by the given user `id` . Mutually exclusive with `author_username` . Combine with `scope=all` or `scope=assigned_to_me` . _([Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/13004) in GitLab 9.5)_ |
2019-07-04 18:46:12 -04:00
| `author_username` | string | no | Return issues created by the given `username` . Similar to `author_id` and mutually exclusive with `author_id` . |
2020-08-20 23:10:16 -04:00
| `confidential` | boolean | no | Filter confidential or public issues. |
2020-10-30 17:08:52 -04:00
| `created_after` | datetime | no | Return issues created on or after the given time. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`) |
| `created_before` | datetime | no | Return issues created on or before the given time. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`) |
2021-09-15 20:11:46 -04:00
| `due_date` | string | no | Return issues that have no due date, are overdue, or whose due date is this week, this month, or between two weeks ago and next month. Accepts: `0` (no due date), `overdue` , `week` , `month` , `next_month_and_previous_two_weeks` . _([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/233420) in GitLab 13.3)_ |
2019-07-04 18:46:12 -04:00
| `iids[]` | integer array | no | Return only the issues having the given `iid` |
2020-08-20 23:10:16 -04:00
| `in` | string | no | Modify the scope of the `search` attribute. `title` , `description` , or a string joining them with comma. Default is `title,description` |
2021-09-15 20:11:46 -04:00
| `issue_type` | string | no | Filter to a given type of issue. One of `issue` , `incident` , or `test_case` . _([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/260375) in GitLab 13.12)_ |
2021-02-11 10:09:11 -05:00
| `iteration_id` ** (PREMIUM)** | integer | no | Return issues assigned to the given iteration ID. `None` returns issues that do not belong to an iteration. `Any` returns issues that belong to an iteration. Mutually exclusive with `iteration_title` . _([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/118742) in GitLab 13.6)_ |
| `iteration_title` ** (PREMIUM)** | string | no | Return issues assigned to the iteration with the given title. Similar to `iteration_id` and mutually exclusive with `iteration_id` . _([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/118742) in GitLab 13.6)_ |
2020-08-20 23:10:16 -04:00
| `labels` | string | no | Comma-separated list of label names, issues must have all labels to be returned. `None` lists all issues with no labels. `Any` lists all issues with at least one label. `No+Label` (Deprecated) lists all issues with no labels. Predefined names are case-insensitive. |
2021-09-02 05:11:35 -04:00
| `milestone` | string | no | The milestone title. `None` lists all issues with no milestone. `Any` lists all issues that have an assigned milestone. Using `None` or `Any` will be [deprecated in the future ](https://gitlab.com/gitlab-org/gitlab/-/issues/336044 ). Please use `milestone_id` attribute instead. `milestone` and `milestone_id` are mutually exclusive. |
| `milestone_id` | string | no | Returns issues assigned to milestones with a given timebox value (`None`, `Any` , `Upcoming` , and `Started` ). `None` lists all issues with no milestone. `Any` lists all issues that have an assigned milestone. `Upcoming` lists all issues assigned to milestones due in the future. `Started` lists all issues assigned to open, started milestones. `milestone` and `milestone_id` are mutually exclusive. _([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/335939) in GitLab 14.3)_ |
2020-08-20 23:10:16 -04:00
| `my_reaction_emoji` | string | no | Return issues reacted by the authenticated user by the given `emoji` . `None` returns issues not given a reaction. `Any` returns issues given at least one reaction. _([Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/14016) in GitLab 10.0)_ |
2021-09-15 20:11:46 -04:00
| `non_archived` | boolean | no | Return issues only from non-archived projects. If `false` , the response returns issues from both archived and non-archived projects. Default is `true` . _([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/197170) in GitLab 13.0)_ |
2021-09-02 05:11:35 -04:00
| `not` | Hash | no | Return issues that do not match the parameters supplied. Accepts: `assignee_id` , `assignee_username` , `author_id` , `author_username` , `iids` , `iteration_id` , `iteration_title` , `labels` , `milestone` , `milestone_id` and `weight` . |
2021-09-09 05:11:16 -04:00
| `order_by` | string | no | Return issues ordered by `created_at` , `due_date` , `label_priority` , `milestone_due` , `popularity` , `priority` , `relative_position` , `title` , `updated_at` , or `weight` fields. Default is `created_at` . |
2020-08-20 23:10:16 -04:00
| `scope` | string | no | Return issues for the given scope: `created_by_me` , `assigned_to_me` or `all` . Defaults to `created_by_me` < br > For versions before 11.0, use the now deprecated `created-by-me` or `assigned-to-me` scopes instead.< br > _([Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/13004) in GitLab 9.5. [Changed to snake_case ](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/18935 ) in GitLab 11.0)_ |
2017-09-03 03:34:50 -04:00
| `search` | string | no | Search issues against their `title` and `description` |
2020-08-20 23:10:16 -04:00
| `sort` | string | no | Return issues sorted in `asc` or `desc` order. Default is `desc` |
| `state` | string | no | Return `all` issues or just those that are `opened` or `closed` |
2020-10-30 17:08:52 -04:00
| `updated_after` | datetime | no | Return issues updated on or after the given time. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`) |
| `updated_before` | datetime | no | Return issues updated on or before the given time. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`) |
2021-05-04 08:10:04 -04:00
| `weight` ** (PREMIUM)** | integer | no | Return issues with the specified `weight` . `None` returns issues with no weight assigned. `Any` returns issues with a weight assigned. |
2021-09-15 20:11:46 -04:00
| `with_labels_details` | boolean | no | If `true` , the response returns more details for each label in labels field: `:name` , `:color` , `:description` , `:description_html` , `:text_color` . Default is `false` . The `description_html` attribute was [introduced ](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/21413 ) in GitLab 12.7|
2016-01-18 03:10:46 -05:00
2020-01-30 10:09:15 -05:00
```shell
2020-05-27 20:08:37 -04:00
curl --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/issues"
2016-01-18 03:10:46 -05:00
```
2014-08-14 06:41:16 -04:00
2016-01-18 03:10:46 -05:00
Example response:
2014-08-14 06:41:16 -04:00
2012-07-24 08:25:01 -04:00
```json
[
2016-01-18 03:10:46 -05:00
{
"state" : "opened",
"description" : "Ratione dolores corrupti mollitia soluta quia.",
"author" : {
"state" : "active",
"id" : 18,
2016-10-13 07:24:09 -04:00
"web_url" : "https://gitlab.example.com/eileen.lowe",
2016-01-18 03:10:46 -05:00
"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,
2017-05-04 08:11:15 -04:00
"assignees" : [{
"state" : "active",
"id" : 1,
"name" : "Administrator",
"web_url" : "https://gitlab.example.com/root",
"avatar_url" : null,
"username" : "root"
}],
2016-01-18 03:10:46 -05:00
"assignee" : {
"state" : "active",
"id" : 1,
"name" : "Administrator",
2016-10-13 07:24:09 -04:00
"web_url" : "https://gitlab.example.com/root",
2016-01-18 03:10:46 -05:00
"avatar_url" : null,
"username" : "root"
},
2021-05-05 08:10:33 -04:00
"type" : "ISSUE",
2016-01-18 03:10:46 -05:00
"updated_at" : "2016-01-04T15:31:51.081Z",
2017-09-16 05:51:02 -04:00
"closed_at" : null,
2018-02-27 12:21:37 -05:00
"closed_by" : null,
2016-01-18 03:10:46 -05:00
"id" : 76,
"title" : "Consequatur vero maxime deserunt laboriosam est voluptas dolorem.",
"created_at" : "2016-01-04T15:31:51.081Z",
2019-11-27 07:06:30 -05:00
"moved_to_id" : null,
2016-01-18 03:10:46 -05:00
"iid" : 6,
2019-04-24 09:08:14 -04:00
"labels" : ["foo", "bar"],
2019-01-24 12:48:51 -05:00
"upvotes": 4,
"downvotes": 0,
2019-02-19 06:30:07 -05:00
"merge_requests_count": 0,
2016-07-12 11:59:21 -04:00
"user_notes_count": 1,
2016-08-02 13:37:04 -04:00
"due_date": "2016-07-22",
2020-08-12 08:10:25 -04:00
"web_url": "http://gitlab.example.com/my-group/my-project/issues/6",
2019-12-27 10:08:16 -05:00
"references": {
"short": "#6",
"relative": "my-group/my-project#6",
"full": "my-group/my-project#6"
},
2017-08-19 13:49:39 -04:00
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
2019-04-24 09:08:14 -04:00
"has_tasks": true,
"task_status": "10 of 15 tasks completed",
2017-08-31 06:38:32 -04:00
"confidential": false,
2019-04-24 09:08:14 -04:00
"discussion_locked": false,
2021-05-05 14:10:31 -04:00
"issue_type": "issue",
2019-04-24 09:08:14 -04:00
"_links":{
2020-08-12 08:10:25 -04:00
"self":"http://gitlab.example.com/api/v4/projects/1/issues/76",
"notes":"http://gitlab.example.com/api/v4/projects/1/issues/76/notes",
"award_emoji":"http://gitlab.example.com/api/v4/projects/1/issues/76/award_emoji",
"project":"http://gitlab.example.com/api/v4/projects/1"
2019-04-24 09:08:14 -04:00
},
2019-06-07 05:15:55 -04:00
"task_completion_status":{
"count":0,
"completed_count":0
}
2016-04-08 02:41:10 -04:00
}
2012-07-24 08:25:01 -04:00
]
```
2021-05-04 08:10:04 -04:00
Issues created by users on GitLab Premium or higher include the `weight` property:
2019-07-03 05:32:54 -04:00
```json
[
{
"state" : "opened",
"description" : "Ratione dolores corrupti mollitia soluta quia.",
"weight": null,
...
}
]
```
2021-05-04 08:10:04 -04:00
Issues created by users on GitLab Premium or higher include the `epic` property:
```json
{
"project_id" : 4,
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"epic_iid" : 5, //deprecated, use `iid` of the `epic` attribute
"epic": {
"id" : 42,
"iid" : 5,
"title": "My epic epic",
"url" : "/groups/h5bp/-/epics/5",
"group_id": 8
},
...
}
```
Issues created by users on GitLab Ultimate include the `health_status` property:
2020-08-13 11:10:03 -04:00
```json
[
{
"state" : "opened",
"description" : "Ratione dolores corrupti mollitia soluta quia.",
"health_status": "on_track",
...
}
]
```
2020-12-07 19:09:45 -05:00
WARNING:
2020-08-20 23:10:16 -04:00
The `assignee` column is deprecated. We now show it as a single-sized array `assignees` to conform
to the GitLab EE API.
2017-05-04 08:11:15 -04:00
2021-05-04 08:10:04 -04:00
WARNING:
2021-09-15 20:11:46 -04:00
The `epic_iid` attribute is deprecated and [scheduled for removal ](https://gitlab.com/gitlab-org/gitlab/-/issues/35157 ) in API version 5.
2021-05-04 08:10:04 -04:00
Please use `iid` of the `epic` attribute instead.
2020-12-04 16:09:29 -05:00
NOTE:
2021-09-15 20:11:46 -04:00
The `closed_by` attribute was [introduced ](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042 ) in GitLab 10.6.
2020-08-20 23:10:16 -04:00
This value is only present for issues closed after GitLab 10.6 and if the user account
that closed the issue still exists.
2018-03-03 05:37:13 -05:00
2016-06-07 18:01:54 -04:00
## List group issues
2021-05-18 20:10:43 -04:00
> The `weight` property moved to GitLab Premium in 13.9.
2021-05-04 08:10:04 -04:00
2016-06-07 18:01:54 -04:00
Get a list of a group's issues.
2020-08-20 23:10:16 -04:00
If the group is private, credentials need to be provided for authorization.
2020-06-22 08:08:47 -04:00
The preferred way to do this, is by using [personal access tokens ](../user/profile/personal_access_tokens.md ).
2020-02-27 04:09:01 -05:00
```plaintext
2016-06-07 18:01:54 -04:00
GET /groups/:id/issues
2020-09-30 20:10:16 -04:00
GET /groups/:id/issues?assignee_id=5
GET /groups/:id/issues?author_id=5
GET /groups/:id/issues?confidential=true
GET /groups/:id/issues?iids[]=42& iids[]=43
2016-06-07 18:01:54 -04:00
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
2017-09-03 03:34:50 -04:00
GET /groups/:id/issues?my_reaction_emoji=star
2020-09-30 20:10:16 -04:00
GET /groups/:id/issues?search=issue+title+or+description
GET /groups/:id/issues?state=closed
GET /groups/:id/issues?state=opened
2016-06-07 18:01:54 -04:00
```
2017-09-03 03:34:50 -04:00
| Attribute | Type | Required | Description |
| ------------------- | ---------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------- |
2020-08-20 23:10:16 -04:00
| `assignee_id` | integer | no | Return issues assigned to the given user `id` . Mutually exclusive with `assignee_username` . `None` returns unassigned issues. `Any` returns issues with an assignee. _([Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/13004) in GitLab 9.5)_ |
| `assignee_username` | string array | no | Return issues assigned to the given `username` . Similar to `assignee_id` and mutually exclusive with `assignee_id` . In GitLab CE, the `assignee_username` array should only contain a single value. Otherwise, an invalid parameter error is returned. |
| `author_id` | integer | no | Return issues created by the given user `id` . Mutually exclusive with `author_username` . Combine with `scope=all` or `scope=assigned_to_me` . _([Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/13004) in GitLab 9.5)_ |
| `author_username` | string | no | Return issues created by the given `username` . Similar to `author_id` and mutually exclusive with `author_id` . |
| `confidential` | boolean | no | Filter confidential or public issues. |
2020-10-30 17:08:52 -04:00
| `created_after` | datetime | no | Return issues created on or after the given time. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`) |
| `created_before` | datetime | no | Return issues created on or before the given time. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`) |
2021-09-15 20:11:46 -04:00
| `due_date` | string | no | Return issues that have no due date, are overdue, or whose due date is this week, this month, or between two weeks ago and next month. Accepts: `0` (no due date), `overdue` , `week` , `month` , `next_month_and_previous_two_weeks` . _([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/233420) in GitLab 13.3)_ |
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the group ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2019-07-04 18:46:12 -04:00
| `iids[]` | integer array | no | Return only the issues having the given `iid` |
2021-09-15 20:11:46 -04:00
| `issue_type` | string | no | Filter to a given type of issue. One of `issue` , `incident` , or `test_case` . _([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/260375) in GitLab 13.12)_ |
2021-04-23 14:10:18 -04:00
| `iteration_id` ** (PREMIUM)** | integer | no | Return issues assigned to the given iteration ID. `None` returns issues that do not belong to an iteration. `Any` returns issues that belong to an iteration. Mutually exclusive with `iteration_title` . _([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/118742) in GitLab 13.6)_ |
| `iteration_title` ** (PREMIUM)** | string | no | Return issues assigned to the iteration with the given title. Similar to `iteration_id` and mutually exclusive with `iteration_id` . _([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/118742) in GitLab 13.6)_ |
2020-08-20 23:10:16 -04:00
| `labels` | string | no | Comma-separated list of label names, issues must have all labels to be returned. `None` lists all issues with no labels. `Any` lists all issues with at least one label. `No+Label` (Deprecated) lists all issues with no labels. Predefined names are case-insensitive. |
2018-10-26 08:38:24 -04:00
| `milestone` | string | no | The milestone title. `None` lists all issues with no milestone. `Any` lists all issues that have an assigned milestone. |
2020-03-31 23:07:57 -04:00
| `my_reaction_emoji` | string | no | Return issues reacted by the authenticated user by the given `emoji` . `None` returns issues not given a reaction. `Any` returns issues given at least one reaction. _([Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/14016) in GitLab 10.0)_ |
2021-09-15 20:11:46 -04:00
| `non_archived` | boolean | no | Return issues from non archived projects. Default is true. _([Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/23785) in GitLab 12.8)_ |
2020-08-20 23:10:16 -04:00
| `not` | Hash | no | Return issues that do not match the parameters supplied. Accepts: `labels` , `milestone` , `author_id` , `author_username` , `assignee_id` , `assignee_username` , `my_reaction_emoji` , `search` , `in` |
2019-08-15 06:56:33 -04:00
| `order_by` | string | no | Return issues ordered by `created_at` , `updated_at` , `priority` , `due_date` , `relative_position` , `label_priority` , `milestone_due` , `popularity` , `weight` fields. Default is `created_at` |
2020-08-20 23:10:16 -04:00
| `scope` | string | no | Return issues for the given scope: `created_by_me` , `assigned_to_me` or `all` .< br > For versions before 11.0, use the now deprecated `created-by-me` or `assigned-to-me` scopes instead.< br > _([Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/13004) in GitLab 9.5. [Changed to snake_case ](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/18935 ) in GitLab 11.0)_ |
2017-09-03 03:34:50 -04:00
| `search` | string | no | Search group issues against their `title` and `description` |
2020-08-20 23:10:16 -04:00
| `sort` | string | no | Return issues sorted in `asc` or `desc` order. Default is `desc` |
| `state` | string | no | Return all issues or just those that are `opened` or `closed` |
2020-10-30 17:08:52 -04:00
| `updated_after` | datetime | no | Return issues updated on or after the given time. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`) |
| `updated_before` | datetime | no | Return issues updated on or before the given time. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`) |
2021-05-04 08:10:04 -04:00
| `weight` ** (PREMIUM)** | integer | no | Return issues with the specified `weight` . `None` returns issues with no weight assigned. `Any` returns issues with a weight assigned. |
2021-09-15 20:11:46 -04:00
| `with_labels_details` | boolean | no | If `true` , the response returns more details for each label in labels field: `:name` , `:color` , `:description` , `:description_html` , `:text_color` . Default is `false` . The `description_html` attribute was [introduced ](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/21413 ) in GitLab 12.7 |
2016-06-07 18:01:54 -04:00
2020-01-30 10:09:15 -05:00
```shell
2020-05-27 20:08:37 -04:00
curl --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/groups/4/issues"
2016-06-07 18:01:54 -04:00
```
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",
2016-10-13 07:24:09 -04:00
"web_url" : "https://gitlab.example.com/root",
2016-06-07 18:01:54 -04:00
"avatar_url" : null,
"username" : "root",
"id" : 1,
"name" : "Administrator"
},
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"state" : "closed",
"iid" : 1,
2017-05-04 08:11:15 -04:00
"assignees" : [{
"avatar_url" : null,
"web_url" : "https://gitlab.example.com/lennie",
"state" : "active",
"username" : "lennie",
"id" : 9,
"name" : "Dr. Luella Kovacek"
}],
2016-06-07 18:01:54 -04:00
"assignee" : {
"avatar_url" : null,
2016-10-13 07:24:09 -04:00
"web_url" : "https://gitlab.example.com/lennie",
2016-06-07 18:01:54 -04:00
"state" : "active",
"username" : "lennie",
"id" : 9,
"name" : "Dr. Luella Kovacek"
},
2021-05-05 08:10:33 -04:00
"type" : "ISSUE",
2019-04-24 09:08:14 -04:00
"labels" : ["foo", "bar"],
2019-01-24 12:48:51 -05:00
"upvotes": 4,
"downvotes": 0,
2019-02-19 06:30:07 -05:00
"merge_requests_count": 0,
2016-06-07 18:01:54 -04:00
"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",
2017-09-16 05:51:02 -04:00
"closed_at" : null,
2018-02-27 12:21:37 -05:00
"closed_by" : null,
2016-07-12 11:59:21 -04:00
"user_notes_count": 1,
2016-08-02 13:37:04 -04:00
"due_date": null,
2020-08-12 08:10:25 -04:00
"web_url": "http://gitlab.example.com/my-group/my-project/issues/1",
2019-12-27 10:08:16 -05:00
"references": {
"short": "#1",
"relative": "my-project#1",
"full": "my-group/my-project#1"
},
2017-08-19 13:49:39 -04:00
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
2019-04-24 09:08:14 -04:00
"has_tasks": true,
"task_status": "10 of 15 tasks completed",
2017-08-31 06:38:32 -04:00
"confidential": false,
2019-04-24 09:08:14 -04:00
"discussion_locked": false,
2021-05-05 14:10:31 -04:00
"issue_type": "issue",
2019-04-24 09:08:14 -04:00
"_links":{
2020-08-12 08:10:25 -04:00
"self":"http://gitlab.example.com/api/v4/projects/4/issues/41",
"notes":"http://gitlab.example.com/api/v4/projects/4/issues/41/notes",
"award_emoji":"http://gitlab.example.com/api/v4/projects/4/issues/41/award_emoji",
"project":"http://gitlab.example.com/api/v4/projects/4"
2019-04-24 09:08:14 -04:00
},
2019-06-07 05:15:55 -04:00
"task_completion_status":{
"count":0,
"completed_count":0
}
2016-06-07 18:01:54 -04:00
}
]
```
2021-05-04 08:10:04 -04:00
Issues created by users on GitLab Premium or higher include the `weight` property:
2019-07-03 05:32:54 -04:00
```json
[
{
"project_id" : 4,
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"weight": null,
...
}
]
```
2021-05-04 08:10:04 -04:00
Issues created by users on GitLab Premium or higher include the `epic` property:
```json
{
"project_id" : 4,
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"epic_iid" : 5, //deprecated, use `iid` of the `epic` attribute
"epic": {
"id" : 42,
"iid" : 5,
"title": "My epic epic",
"url" : "/groups/h5bp/-/epics/5",
"group_id": 8
},
...
}
```
Issues created by users on GitLab Ultimate include the `health_status` property:
2020-08-13 11:10:03 -04:00
```json
[
{
"project_id" : 4,
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"health_status": "at_risk",
...
}
]
```
2020-12-07 19:09:45 -05:00
WARNING:
2020-08-20 23:10:16 -04:00
The `assignee` column is deprecated. We now show it as a single-sized array `assignees` to conform to the GitLab EE API.
2017-05-04 08:11:15 -04:00
2021-05-04 08:10:04 -04:00
WARNING:
2021-09-15 20:11:46 -04:00
The `epic_iid` attribute is deprecated and [scheduled for removal ](https://gitlab.com/gitlab-org/gitlab/-/issues/35157 ) in API version 5.
2021-05-04 08:10:04 -04:00
Please use `iid` of the `epic` attribute instead.
2020-12-04 16:09:29 -05:00
NOTE:
2021-09-15 20:11:46 -04:00
The `closed_by` attribute was [introduced ](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042 ) in GitLab 10.6.
2020-08-20 23:10:16 -04:00
This value is only present for issues closed after GitLab 10.6 and if the user account that closed
the issue still exists.
2018-03-03 05:37:13 -05:00
2012-07-24 08:25:01 -04:00
## List project issues
2021-05-18 20:10:43 -04:00
> The `weight` property moved to GitLab Premium in 13.9.
2021-05-04 08:10:04 -04:00
2016-01-18 03:10:46 -05:00
Get a list of a project's issues.
2012-07-24 08:25:01 -04:00
2020-08-20 23:10:16 -04:00
If the project is private, you need to provide credentials to authorize.
2020-06-22 08:08:47 -04:00
The preferred way to do this, is by using [personal access tokens ](../user/profile/personal_access_tokens.md ).
2020-02-27 04:09:01 -05:00
```plaintext
2012-07-24 08:25:01 -04:00
GET /projects/:id/issues
2020-09-30 20:10:16 -04:00
GET /projects/:id/issues?assignee_id=5
GET /projects/:id/issues?author_id=5
GET /projects/:id/issues?confidential=true
GET /projects/:id/issues?iids[]=42& iids[]=43
2014-08-14 10:17:19 -04:00
GET /projects/:id/issues?labels=foo
GET /projects/:id/issues?labels=foo,bar
GET /projects/:id/issues?labels=foo,bar& state=opened
2014-09-04 18:01:12 -04:00
GET /projects/:id/issues?milestone=1.0.0
GET /projects/:id/issues?milestone=1.0.0& state=opened
2017-09-03 03:34:50 -04:00
GET /projects/:id/issues?my_reaction_emoji=star
2020-09-30 20:10:16 -04:00
GET /projects/:id/issues?search=issue+title+or+description
GET /projects/:id/issues?state=closed
GET /projects/:id/issues?state=opened
2012-07-24 08:25:01 -04:00
```
2017-09-03 03:34:50 -04:00
| Attribute | Type | Required | Description |
| ------------------- | ---------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------- |
2020-08-20 23:10:16 -04:00
| `assignee_id` | integer | no | Return issues assigned to the given user `id` . Mutually exclusive with `assignee_username` . `None` returns unassigned issues. `Any` returns issues with an assignee. _([Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/13004) in GitLab 9.5)_ |
| `assignee_username` | string array | no | Return issues assigned to the given `username` . Similar to `assignee_id` and mutually exclusive with `assignee_id` . In GitLab CE, the `assignee_username` array should only contain a single value. Otherwise, an invalid parameter error is returned. |
| `author_id` | integer | no | Return issues created by the given user `id` . Mutually exclusive with `author_username` . Combine with `scope=all` or `scope=assigned_to_me` . _([Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/13004) in GitLab 9.5)_ |
| `author_username` | string | no | Return issues created by the given `username` . Similar to `author_id` and mutually exclusive with `author_id` . |
| `confidential` | boolean | no | Filter confidential or public issues. |
2020-10-30 17:08:52 -04:00
| `created_after` | datetime | no | Return issues created on or after the given time. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`) |
| `created_before` | datetime | no | Return issues created on or before the given time. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`) |
2021-09-15 20:11:46 -04:00
| `due_date` | string | no | Return issues that have no due date, are overdue, or whose due date is this week, this month, or between two weeks ago and next month. Accepts: `0` (no due date), `overdue` , `week` , `month` , `next_month_and_previous_two_weeks` . _([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/233420) in GitLab 13.3)_ |
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2020-05-21 08:08:08 -04:00
| `iids[]` | integer array | no | Return only the issues having the given `iid` |
2021-09-15 20:11:46 -04:00
| `issue_type` | string | no | Filter to a given type of issue. One of `issue` , `incident` , or `test_case` . _([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/260375) in GitLab 13.12)_ |
2021-04-23 14:10:18 -04:00
| `iteration_id` ** (PREMIUM)** | integer | no | Return issues assigned to the given iteration ID. `None` returns issues that do not belong to an iteration. `Any` returns issues that belong to an iteration. Mutually exclusive with `iteration_title` . _([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/118742) in GitLab 13.6)_ |
| `iteration_title` ** (PREMIUM)** | string | no | Return issues assigned to the iteration with the given title. Similar to `iteration_id` and mutually exclusive with `iteration_id` . _([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/118742) in GitLab 13.6)_ |
2018-10-29 05:50:18 -04:00
| `labels` | string | no | Comma-separated list of label names, issues must have all labels to be returned. `None` lists all issues with no labels. `Any` lists all issues with at least one label. `No+Label` (Deprecated) lists all issues with no labels. Predefined names are case-insensitive. |
2018-10-26 08:38:24 -04:00
| `milestone` | string | no | The milestone title. `None` lists all issues with no milestone. `Any` lists all issues that have an assigned milestone. |
2020-03-31 23:07:57 -04:00
| `my_reaction_emoji` | string | no | Return issues reacted by the authenticated user by the given `emoji` . `None` returns issues not given a reaction. `Any` returns issues given at least one reaction. _([Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/14016) in GitLab 10.0)_ |
2020-08-20 23:10:16 -04:00
| `not` | Hash | no | Return issues that do not match the parameters supplied. Accepts: `labels` , `milestone` , `author_id` , `author_username` , `assignee_id` , `assignee_username` , `my_reaction_emoji` , `search` , `in` |
2019-08-15 06:56:33 -04:00
| `order_by` | string | no | Return issues ordered by `created_at` , `updated_at` , `priority` , `due_date` , `relative_position` , `label_priority` , `milestone_due` , `popularity` , `weight` fields. Default is `created_at` |
2020-12-17 19:10:04 -05:00
| `scope` | string | no | Return issues for the given scope: `created_by_me` , `assigned_to_me` or `all` .< br > For versions before 11.0, use the deprecated `created-by-me` or `assigned-to-me` scopes instead.< br > _([Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/13004) in GitLab 9.5. [Changed to snake_case ](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/18935 ) in GitLab 11.0)_ |
2017-09-03 03:34:50 -04:00
| `search` | string | no | Search project issues against their `title` and `description` |
2020-08-20 23:10:16 -04:00
| `sort` | string | no | Return issues sorted in `asc` or `desc` order. Default is `desc` |
| `state` | string | no | Return all issues or just those that are `opened` or `closed` |
2020-10-30 17:08:52 -04:00
| `updated_after` | datetime | no | Return issues updated on or after the given time. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`) |
| `updated_before` | datetime | no | Return issues updated on or before the given time. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`) |
2021-05-04 08:10:04 -04:00
| `weight` ** (PREMIUM)** | integer | no | Return issues with the specified `weight` . `None` returns issues with no weight assigned. `Any` returns issues with a weight assigned. |
2021-09-15 20:11:46 -04:00
| `with_labels_details` | boolean | no | If `true` , the response returns more details for each label in labels field: `:name` , `:color` , `:description` , `:description_html` , `:text_color` . Default is `false` . `description_html` was [introduced ](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/21413 ) in GitLab 12.7 |
2019-02-25 06:00:24 -05:00
2020-01-30 10:09:15 -05:00
```shell
2020-05-27 20:08:37 -04:00
curl --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/projects/4/issues"
2016-01-18 03:10:46 -05:00
```
Example response:
2012-07-24 08:25:01 -04:00
2016-01-18 03:10:46 -05:00
```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",
2016-10-13 07:24:09 -04:00
"web_url" : "https://gitlab.example.com/root",
2016-01-18 03:10:46 -05:00
"avatar_url" : null,
"username" : "root",
"id" : 1,
"name" : "Administrator"
},
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"state" : "closed",
"iid" : 1,
2017-05-04 08:11:15 -04:00
"assignees" : [{
"avatar_url" : null,
"web_url" : "https://gitlab.example.com/lennie",
"state" : "active",
"username" : "lennie",
"id" : 9,
"name" : "Dr. Luella Kovacek"
}],
2016-01-18 03:10:46 -05:00
"assignee" : {
"avatar_url" : null,
2016-10-13 07:24:09 -04:00
"web_url" : "https://gitlab.example.com/lennie",
2016-01-18 03:10:46 -05:00
"state" : "active",
"username" : "lennie",
"id" : 9,
"name" : "Dr. Luella Kovacek"
},
2021-05-05 08:10:33 -04:00
"type" : "ISSUE",
2019-04-24 09:08:14 -04:00
"labels" : ["foo", "bar"],
2019-01-24 12:48:51 -05:00
"upvotes": 4,
"downvotes": 0,
2019-02-19 06:30:07 -05:00
"merge_requests_count": 0,
2016-01-18 03:10:46 -05:00
"id" : 41,
"title" : "Ut commodi ullam eos dolores perferendis nihil sunt.",
"updated_at" : "2016-01-04T15:31:46.176Z",
2016-04-08 02:41:10 -04:00
"created_at" : "2016-01-04T15:31:46.176Z",
2017-09-16 05:51:02 -04:00
"closed_at" : "2016-01-05T15:31:46.176Z",
2018-02-27 12:21:37 -05:00
"closed_by" : {
"state" : "active",
"web_url" : "https://gitlab.example.com/root",
"avatar_url" : null,
"username" : "root",
"id" : 1,
"name" : "Administrator"
},
2016-07-12 11:59:21 -04:00
"user_notes_count": 1,
2016-08-02 13:37:04 -04:00
"due_date": "2016-07-22",
2020-08-12 08:10:25 -04:00
"web_url": "http://gitlab.example.com/my-group/my-project/issues/1",
2019-12-27 10:08:16 -05:00
"references": {
"short": "#1",
"relative": "#1",
"full": "my-group/my-project#1"
},
2017-08-19 13:49:39 -04:00
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
2019-04-24 09:08:14 -04:00
"has_tasks": true,
"task_status": "10 of 15 tasks completed",
2017-08-31 06:38:32 -04:00
"confidential": false,
2019-04-24 09:08:14 -04:00
"discussion_locked": false,
2021-05-05 14:10:31 -04:00
"issue_type": "issue",
2019-04-24 09:08:14 -04:00
"_links":{
2020-08-12 08:10:25 -04:00
"self":"http://gitlab.example.com/api/v4/projects/4/issues/41",
"notes":"http://gitlab.example.com/api/v4/projects/4/issues/41/notes",
"award_emoji":"http://gitlab.example.com/api/v4/projects/4/issues/41/award_emoji",
"project":"http://gitlab.example.com/api/v4/projects/4"
2019-04-24 09:08:14 -04:00
},
2019-06-07 05:15:55 -04:00
"task_completion_status":{
"count":0,
"completed_count":0
}
2016-01-18 03:10:46 -05:00
}
]
```
2013-02-27 08:36:20 -05:00
2021-05-04 08:10:04 -04:00
Issues created by users on GitLab Premium or higher include the `weight` property:
2019-07-03 05:32:54 -04:00
```json
[
{
"project_id" : 4,
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"weight": null,
...
}
]
```
2021-05-04 08:10:04 -04:00
Issues created by users on GitLab Premium or higher include the `epic` property:
```json
{
"project_id" : 4,
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"epic_iid" : 5, //deprecated, use `iid` of the `epic` attribute
"epic": {
"id" : 42,
"iid" : 5,
"title": "My epic epic",
"url" : "/groups/h5bp/-/epics/5",
"group_id": 8
},
...
}
```
Issues created by users on GitLab Ultimate include the `health_status` property:
2020-08-13 11:10:03 -04:00
```json
[
{
"project_id" : 4,
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"health_status": "at_risk",
...
}
]
```
2020-12-07 19:09:45 -05:00
WARNING:
2020-08-20 23:10:16 -04:00
The `assignee` column is deprecated. We now show it as a single-sized array `assignees` to conform to the GitLab EE API.
2017-05-04 08:11:15 -04:00
2021-05-04 08:10:04 -04:00
WARNING:
2021-09-15 20:11:46 -04:00
The `epic_iid` attribute is deprecated and [scheduled for removal ](https://gitlab.com/gitlab-org/gitlab/-/issues/35157 ) in API version 5.
2021-05-04 08:10:04 -04:00
Please use `iid` of the `epic` attribute instead.
2020-12-04 16:09:29 -05:00
NOTE:
2021-09-15 20:11:46 -04:00
The `closed_by` attribute was [introduced ](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042 ) in GitLab 10.6. This value is only present for issues closed after GitLab 10.6 and if the user account that closed
2020-08-20 23:10:16 -04:00
the issue still exists.
2018-03-03 05:37:13 -05:00
2012-07-24 08:25:01 -04:00
## Single issue
2020-08-25 11:10:17 -04:00
Only for administrators. Get a single issue.
The preferred way to do this is by using [personal access tokens ](../user/profile/personal_access_tokens.md ).
```plaintext
GET /issues/:id
```
| Attribute | Type | Required | Description |
|-------------|---------|----------|--------------------------------------|
2020-09-30 20:10:16 -04:00
| `id` | integer | yes | The ID of the issue |
2020-08-25 11:10:17 -04:00
```shell
curl --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/issues/41"
```
Example response:
```json
{
2021-04-29 08:09:58 -04:00
"id": 1,
"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",
"closed_at": "2016-01-05T15:31:46.176Z"
},
"author": {
"state": "active",
"web_url": "https://gitlab.example.com/root",
"avatar_url": null,
"username": "root",
"id": 1,
"name": "Administrator"
},
"description": "Omnis vero earum sunt corporis dolor et placeat.",
"state": "closed",
"iid": 1,
"assignees": [
{
"avatar_url": null,
"web_url": "https://gitlab.example.com/lennie",
"state": "active",
"username": "lennie",
"id": 9,
"name": "Dr. Luella Kovacek"
}
],
"assignee": {
"avatar_url": null,
"web_url": "https://gitlab.example.com/lennie",
"state": "active",
"username": "lennie",
"id": 9,
"name": "Dr. Luella Kovacek"
},
2021-05-05 08:10:33 -04:00
"type": "ISSUE",
2021-04-29 08:09:58 -04:00
"labels": [],
"upvotes": 4,
"downvotes": 0,
"merge_requests_count": 0,
"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",
"closed_at": null,
"closed_by": null,
"subscribed": false,
"user_notes_count": 1,
"due_date": null,
"web_url": "http://example.com/my-group/my-project/issues/1",
"references": {
"short": "#1",
"relative": "#1",
"full": "my-group/my-project#1"
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
"confidential": false,
"discussion_locked": false,
2021-05-05 14:10:31 -04:00
"issue_type": "issue",
2021-04-29 08:09:58 -04:00
"task_completion_status": {
"count": 0,
"completed_count": 0
},
"weight": null,
2020-08-25 11:10:17 -04:00
"has_tasks": false,
"_links": {
2020-09-25 02:09:42 -04:00
"self": "http://gitlab.example:3000/api/v4/projects/1/issues/1",
"notes": "http://gitlab.example:3000/api/v4/projects/1/issues/1/notes",
"award_emoji": "http://gitlab.example:3000/api/v4/projects/1/issues/1/award_emoji",
"project": "http://gitlab.example:3000/api/v4/projects/1"
2020-08-25 11:10:17 -04:00
},
"moved_to_id": null,
2021-05-04 08:10:04 -04:00
"service_desk_reply_to": "service.desk@gitlab.com"
2020-08-25 11:10:17 -04:00
}
```
2021-05-04 08:10:04 -04:00
Issues created by users on GitLab Premium or higher include the `weight` property:
2020-08-25 11:10:17 -04:00
```json
{
"project_id" : 4,
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"weight": null,
...
}
```
2021-05-04 08:10:04 -04:00
Issues created by users on GitLab Premium or higher include the `epic` property:
2020-08-25 11:10:17 -04:00
2021-05-04 08:10:04 -04:00
```json
2020-08-25 11:10:17 -04:00
{
"project_id" : 4,
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"epic": {
"epic_iid" : 5, //deprecated, use `iid` of the `epic` attribute
"epic": {
"id" : 42,
"iid" : 5,
"title": "My epic epic",
"url" : "/groups/h5bp/-/epics/5",
"group_id": 8
},
2021-05-04 08:10:04 -04:00
...
2020-08-25 11:10:17 -04:00
}
```
2021-05-04 08:10:04 -04:00
Users of [GitLab Ultimate ](https://about.gitlab.com/pricing/ ) can also see the `health_status`
property:
```json
[
{
"project_id" : 4,
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"health_status": "on_track",
...
}
]
```
2020-12-07 19:09:45 -05:00
WARNING:
2020-09-07 08:08:27 -04:00
The `assignee` column is deprecated. We now show it as a single-sized array `assignees` to conform
to the GitLab EE API.
2020-08-25 11:10:17 -04:00
2020-12-07 19:09:45 -05:00
WARNING:
2021-09-15 20:11:46 -04:00
The `epic_iid` attribute is deprecated, and [scheduled for removal ](https://gitlab.com/gitlab-org/gitlab/-/issues/35157 ) in API version 5.
2020-09-30 20:10:16 -04:00
Please use `iid` of the `epic` attribute instead.
2020-12-04 16:09:29 -05:00
NOTE:
2021-09-15 20:11:46 -04:00
The `closed_by` attribute was [introduced ](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042 ) in GitLab 10.6.
2020-09-07 08:08:27 -04:00
This value is only present for issues closed after GitLab 10.6 and if the user account
that closed the issue still exists.
2020-08-25 11:10:17 -04:00
2020-09-07 08:08:27 -04:00
## Single project issue
2020-08-25 11:10:17 -04:00
2016-01-18 03:10:46 -05:00
Get a single project issue.
2012-07-24 08:25:01 -04:00
2020-08-20 23:10:16 -04:00
If the project is private or the issue is confidential, you need to provide credentials to authorize.
2020-06-22 08:08:47 -04:00
The preferred way to do this, is by using [personal access tokens ](../user/profile/personal_access_tokens.md ).
2020-02-27 04:09:01 -05:00
```plaintext
2017-03-01 01:57:34 -05:00
GET /projects/:id/issues/:issue_iid
2012-07-24 08:25:01 -04:00
```
2017-03-01 01:57:34 -05:00
| Attribute | Type | Required | Description |
2017-04-06 11:18:51 -04:00
|-------------|---------|----------|--------------------------------------|
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2017-03-01 01:57:34 -05:00
| `issue_iid` | integer | yes | The internal ID of a project's issue |
2012-07-24 08:25:01 -04:00
2020-01-30 10:09:15 -05:00
```shell
2020-05-27 20:08:37 -04:00
curl --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/projects/4/issues/41"
2016-01-18 03:10:46 -05:00
```
Example response:
2012-07-24 08:25:01 -04:00
```json
{
2016-01-18 03:10:46 -05:00
"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",
2017-09-16 05:51:02 -04:00
"updated_at" : "2016-01-04T15:31:39.788Z",
"closed_at" : "2016-01-05T15:31:46.176Z"
2016-01-18 03:10:46 -05:00
},
"author" : {
"state" : "active",
2016-10-13 07:24:09 -04:00
"web_url" : "https://gitlab.example.com/root",
2016-01-18 03:10:46 -05:00
"avatar_url" : null,
"username" : "root",
"id" : 1,
"name" : "Administrator"
},
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"state" : "closed",
"iid" : 1,
2017-05-04 08:11:15 -04:00
"assignees" : [{
"avatar_url" : null,
"web_url" : "https://gitlab.example.com/lennie",
"state" : "active",
"username" : "lennie",
"id" : 9,
"name" : "Dr. Luella Kovacek"
}],
2016-01-18 03:10:46 -05:00
"assignee" : {
"avatar_url" : null,
2016-10-13 07:24:09 -04:00
"web_url" : "https://gitlab.example.com/lennie",
2016-01-18 03:10:46 -05:00
"state" : "active",
"username" : "lennie",
"id" : 9,
"name" : "Dr. Luella Kovacek"
},
2021-05-05 08:10:33 -04:00
"type" : "ISSUE",
2016-01-18 03:10:46 -05:00
"labels" : [],
2019-01-24 12:48:51 -05:00
"upvotes": 4,
"downvotes": 0,
2019-02-19 06:30:07 -05:00
"merge_requests_count": 0,
2016-01-18 03:10:46 -05:00
"id" : 41,
"title" : "Ut commodi ullam eos dolores perferendis nihil sunt.",
"updated_at" : "2016-01-04T15:31:46.176Z",
2016-04-08 02:41:10 -04:00
"created_at" : "2016-01-04T15:31:46.176Z",
2018-02-27 12:21:37 -05:00
"closed_at" : null,
"closed_by" : null,
2016-02-23 16:59:32 -05:00
"subscribed": false,
2016-07-12 11:59:21 -04:00
"user_notes_count": 1,
2016-08-02 13:37:04 -04:00
"due_date": null,
2020-08-12 08:10:25 -04:00
"web_url": "http://gitlab.example.com/my-group/my-project/issues/1",
2019-12-27 10:08:16 -05:00
"references": {
"short": "#1",
"relative": "#1",
"full": "my-group/my-project#1"
},
2017-08-19 13:49:39 -04:00
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
2017-07-25 05:35:45 -04:00
"confidential": false,
2017-08-31 06:38:32 -04:00
"discussion_locked": false,
2021-05-05 14:10:31 -04:00
"issue_type": "issue",
2017-07-25 05:35:45 -04:00
"_links": {
2020-08-12 08:10:25 -04:00
"self": "http://gitlab.example.com/api/v4/projects/1/issues/2",
"notes": "http://gitlab.example.com/api/v4/projects/1/issues/2/notes",
"award_emoji": "http://gitlab.example.com/api/v4/projects/1/issues/2/award_emoji",
"project": "http://gitlab.example.com/api/v4/projects/1"
2019-06-07 05:15:55 -04:00
},
"task_completion_status":{
"count":0,
"completed_count":0
2017-07-25 05:35:45 -04:00
}
2012-07-24 08:25:01 -04:00
}
```
2021-05-04 08:10:04 -04:00
Issues created by users on GitLab Premium or higher include the `weight` property:
2019-07-03 05:32:54 -04:00
```json
{
"project_id" : 4,
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"weight": null,
...
}
```
2021-05-04 08:10:04 -04:00
Issues created by users on GitLab Premium or higher include the `epic` property:
2019-09-04 10:44:37 -04:00
2021-05-04 08:10:04 -04:00
```json
2019-09-04 10:44:37 -04:00
{
"project_id" : 4,
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
2019-11-11 13:06:27 -05:00
"epic_iid" : 5, //deprecated, use `iid` of the `epic` attribute
"epic": {
"id" : 42,
"iid" : 5,
"title": "My epic epic",
"url" : "/groups/h5bp/-/epics/5",
"group_id": 8
},
2021-05-04 08:10:04 -04:00
...
2019-09-04 10:44:37 -04:00
}
```
2021-02-08 13:09:49 -05:00
Users of [GitLab Ultimate ](https://about.gitlab.com/pricing/ ) can also see the `health_status`
2020-08-20 23:10:16 -04:00
property:
2020-08-13 11:10:03 -04:00
```json
[
{
"project_id" : 4,
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"health_status": "on_track",
...
}
]
```
2020-12-07 19:09:45 -05:00
WARNING:
2020-08-20 23:10:16 -04:00
The `assignee` column is deprecated. We now show it as a single-sized array `assignees` to conform to the GitLab EE API.
2017-05-04 08:11:15 -04:00
2020-12-07 19:09:45 -05:00
WARNING:
2021-09-15 20:11:46 -04:00
The `epic_iid` attribute is deprecated and [scheduled for removal ](https://gitlab.com/gitlab-org/gitlab/-/issues/35157 ) in API version 5.
2020-09-30 20:10:16 -04:00
Please use `iid` of the `epic` attribute instead.
2020-12-04 16:09:29 -05:00
NOTE:
2021-09-15 20:11:46 -04:00
The `closed_by` attribute was [introduced ](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042 ) in GitLab 10.6. This value is only present for issues closed after GitLab 10.6 and if the user account that closed
2020-08-20 23:10:16 -04:00
the issue still exists.
2018-03-03 05:37:13 -05:00
2012-07-24 08:25:01 -04:00
## New issue
2021-05-18 20:10:43 -04:00
> The `weight` property moved to GitLab Premium in 13.9.
2021-05-04 08:10:04 -04:00
2013-02-27 08:36:20 -05:00
Creates a new project issue.
2012-07-24 08:25:01 -04:00
2020-02-27 04:09:01 -05:00
```plaintext
2012-07-24 08:25:01 -04:00
POST /projects/:id/issues
```
2017-05-04 08:11:15 -04:00
| Attribute | Type | Required | Description |
|-------------------------------------------|----------------|----------|--------------|
2021-04-28 14:10:12 -04:00
| `assignee_id` | integer | no | The ID of the user to assign the issue to. Only appears on GitLab Free. |
| `assignee_ids` ** (PREMIUM)** | integer array | no | The IDs of the users to assign the issue to. |
2020-09-30 20:10:16 -04:00
| `confidential` | boolean | no | Set an issue to be confidential. Default is `false` . |
| `created_at` | string | no | When the issue was created. Date time string, ISO 8601 formatted, for example `2016-03-11T03:45:40Z` . Requires administrator or project/group owner rights. |
| `description` | string | no | The description of an issue. Limited to 1,048,576 characters. |
| `discussion_to_resolve` | string | no | The ID of a discussion to resolve. This fills out the issue with a default description and mark the discussion as resolved. Use in combination with `merge_request_to_resolve_discussions_of` . |
2020-12-17 19:10:04 -05:00
| `due_date` | string | no | The due date. Date time string in the format `YYYY-MM-DD` , for example `2016-03-11` |
2020-09-30 20:10:16 -04:00
| `epic_id` ** (PREMIUM)** | integer | no | ID of the epic to add the issue to. Valid values are greater than or equal to 0. |
2021-09-15 20:11:46 -04:00
| `epic_iid` ** (PREMIUM)** | integer | no | IID of the epic to add the issue to. Valid values are greater than or equal to 0. (deprecated, [scheduled for removal ](https://gitlab.com/gitlab-org/gitlab/-/issues/35157 ) in API version 5) |
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2020-08-20 23:10:16 -04:00
| `iid` | integer/string | no | The internal ID of the project's issue (requires administrator or project owner rights) |
2021-05-05 14:10:31 -04:00
| `issue_type` | string | no | The type of issue. One of `issue` , `incident` , or `test_case` . Default is `issue` . |
2019-07-03 05:32:54 -04:00
| `labels` | string | no | Comma-separated label names for an issue |
2020-08-20 23:10:16 -04:00
| `merge_request_to_resolve_discussions_of` | integer | no | The IID of a merge request in which to resolve all issues. This fills out the issue with a default description and mark all discussions as resolved. When passing a description or title, these values take precedence over the default values.|
2021-05-21 14:11:01 -04:00
| `milestone_id` | integer | no | The global ID of a milestone to assign issue. To find the `milestone_id` associated with a milestone, view an issue with the milestone assigned and [use the API ](#single-project-issue ) to retrieve the issue's details. |
2020-09-30 20:10:16 -04:00
| `title` | string | yes | The title of an issue |
2021-05-04 08:10:04 -04:00
| `weight` ** (PREMIUM)** | integer | no | The weight of the issue. Valid values are greater than or equal to 0. |
2016-01-18 03:10:46 -05:00
2020-01-30 10:09:15 -05:00
```shell
2020-05-27 20:08:37 -04:00
curl --request POST --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/projects/4/issues?title=Issues%20with%20auth& labels=bug"
2016-01-18 03:10:46 -05:00
```
2012-07-24 08:25:01 -04:00
2016-01-18 03:10:46 -05:00
Example response:
2012-07-24 08:25:01 -04:00
2016-01-18 03:10:46 -05:00
```json
{
"project_id" : 4,
"id" : 84,
"created_at" : "2016-01-07T12:44:33.959Z",
"iid" : 14,
"title" : "Issues with auth",
"state" : "opened",
2017-05-04 08:11:15 -04:00
"assignees" : [],
2016-01-18 03:10:46 -05:00
"assignee" : null,
2021-05-05 08:10:33 -04:00
"type" : "ISSUE",
2016-01-18 03:10:46 -05:00
"labels" : [
"bug"
],
2019-01-24 12:48:51 -05:00
"upvotes": 4,
"downvotes": 0,
2019-02-19 06:30:07 -05:00
"merge_requests_count": 0,
2016-01-18 03:10:46 -05:00
"author" : {
"name" : "Alexandra Bashirian",
"avatar_url" : null,
"state" : "active",
2016-10-13 07:24:09 -04:00
"web_url" : "https://gitlab.example.com/eileen.lowe",
2016-01-18 03:10:46 -05:00
"id" : 18,
"username" : "eileen.lowe"
},
"description" : null,
"updated_at" : "2016-01-07T12:44:33.959Z",
2017-09-16 05:51:02 -04:00
"closed_at" : null,
2018-02-27 12:21:37 -05:00
"closed_by" : null,
2016-04-08 02:41:10 -04:00
"milestone" : null,
2016-02-23 16:59:32 -05:00
"subscribed" : true,
2016-07-12 11:59:21 -04:00
"user_notes_count": 0,
2016-08-02 13:37:04 -04:00
"due_date": null,
2020-08-12 08:10:25 -04:00
"web_url": "http://gitlab.example.com/my-group/my-project/issues/14",
2019-12-27 10:08:16 -05:00
"references": {
"short": "#14",
"relative": "#14",
"full": "my-group/my-project#14"
},
2017-08-19 13:49:39 -04:00
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
2017-07-25 05:35:45 -04:00
"confidential": false,
2017-08-31 06:38:32 -04:00
"discussion_locked": false,
2021-05-05 14:10:31 -04:00
"issue_type": "issue",
2017-07-25 05:35:45 -04:00
"_links": {
2020-08-12 08:10:25 -04:00
"self": "http://gitlab.example.com/api/v4/projects/1/issues/2",
"notes": "http://gitlab.example.com/api/v4/projects/1/issues/2/notes",
"award_emoji": "http://gitlab.example.com/api/v4/projects/1/issues/2/award_emoji",
"project": "http://gitlab.example.com/api/v4/projects/1"
2019-06-07 05:15:55 -04:00
},
"task_completion_status":{
"count":0,
"completed_count":0
2017-07-25 05:35:45 -04:00
}
2016-01-18 03:10:46 -05:00
}
```
2014-08-14 04:17:52 -04:00
2021-05-04 08:10:04 -04:00
Issues created by users on GitLab Premium or higher include the `weight` property:
2019-07-03 05:32:54 -04:00
```json
{
"project_id" : 4,
"description" : null,
"weight": null,
...
}
```
2021-05-04 08:10:04 -04:00
Issues created by users on GitLab Premium or higher include the `epic` property:
```json
{
"project_id" : 4,
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"epic_iid" : 5, //deprecated, use `iid` of the `epic` attribute
"epic": {
"id" : 42,
"iid" : 5,
"title": "My epic epic",
"url" : "/groups/h5bp/-/epics/5",
"group_id": 8
},
...
}
```
Issues created by users on GitLab Ultimate include the `health_status` property:
2020-08-13 11:10:03 -04:00
```json
[
{
"project_id" : 4,
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"health_status": "on_track",
...
}
]
```
2020-12-07 19:09:45 -05:00
WARNING:
2020-08-20 23:10:16 -04:00
The `assignee` column is deprecated. We now show it as a single-sized array `assignees` to conform to the GitLab EE API.
2017-05-04 08:11:15 -04:00
2021-05-04 08:10:04 -04:00
WARNING:
2021-09-15 20:11:46 -04:00
The `epic_iid` attribute is deprecated and [scheduled for removal ](https://gitlab.com/gitlab-org/gitlab/-/issues/35157 ) in API version 5.
2021-05-04 08:10:04 -04:00
Please use `iid` of the `epic` attribute instead.
2020-12-04 16:09:29 -05:00
NOTE:
2021-09-15 20:11:46 -04:00
The `closed_by` attribute was [introduced ](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042 ) in GitLab 10.6. This value is only present for issues closed after GitLab 10.6 and if the user account that closed
2020-08-20 23:10:16 -04:00
the issue still exists.
2018-03-03 05:37:13 -05:00
2020-04-15 11:09:17 -04:00
## Rate limits
2020-07-20 14:09:27 -04:00
To help avoid abuse, users can be limited to a specific number of `Create` requests per minute.
See [Issues rate limits ](../user/admin_area/settings/rate_limit_on_issues_creation.md ).
2020-04-15 11:09:17 -04:00
2012-07-24 08:25:01 -04:00
## Edit issue
2021-05-18 20:10:43 -04:00
> The `weight` property moved to GitLab Premium in 13.9.
2021-05-04 08:10:04 -04:00
2016-01-18 03:10:46 -05:00
Updates an existing project issue. This call is also used to mark an issue as
closed.
2020-09-30 20:10:16 -04:00
At least one of the following parameters is required for the request to be successful:
- `:assignee_id`
- `:assignee_ids`
- `:confidential`
- `:created_at`
- `:description`
- `:discussion_locked`
- `:due_date`
2021-05-05 14:10:31 -04:00
- `:issue_type`
2020-09-30 20:10:16 -04:00
- `:labels`
- `:milestone_id`
- `:state_event`
- `:title`
2020-02-27 04:09:01 -05:00
```plaintext
2017-03-01 01:57:34 -05:00
PUT /projects/:id/issues/:issue_iid
2012-07-24 08:25:01 -04:00
```
2017-03-01 01:57:34 -05:00
| Attribute | Type | Required | Description |
2017-04-06 11:18:51 -04:00
|----------------|---------|----------|------------------------------------------------------------------------------------------------------------|
2020-09-30 20:10:16 -04:00
| `add_labels` | string | no | Comma-separated label names to add to an issue. |
| `assignee_ids` | integer array | no | The ID of the user(s) to assign the issue to. Set to `0` or provide an empty value to unassign all assignees. |
| `confidential` | boolean | no | Updates an issue to be confidential |
| `description` | string | no | The description of an issue. Limited to 1,048,576 characters. |
| `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. |
2020-12-17 19:10:04 -05:00
| `due_date` | string | no | The due date. Date time string in the format `YYYY-MM-DD` , for example `2016-03-11` |
2020-09-30 20:10:16 -04:00
| `epic_id` ** (PREMIUM)** | integer | no | ID of the epic to add the issue to. Valid values are greater than or equal to 0. |
2021-09-15 20:11:46 -04:00
| `epic_iid` ** (PREMIUM)** | integer | no | IID of the epic to add the issue to. Valid values are greater than or equal to 0. (deprecated, [scheduled for removal ](https://gitlab.com/gitlab-org/gitlab/-/issues/35157 ) in API version 5) |
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2017-03-01 01:57:34 -05:00
| `issue_iid` | integer | yes | The internal ID of a project's issue |
2021-05-05 14:10:31 -04:00
| `issue_type` | string | no | Updates the type of issue. One of `issue` , `incident` , or `test_case` . |
2017-11-30 08:45:36 -05:00
| `labels` | string | no | Comma-separated label names for an issue. Set to an empty string to unassign all labels. |
2020-09-30 20:10:16 -04:00
| `milestone_id` | integer | no | The global ID of a milestone to assign the issue to. Set to `0` or provide an empty value to unassign a milestone.|
2020-05-20 17:09:09 -04:00
| `remove_labels` | string | no | Comma-separated label names to remove from an issue. |
2017-03-01 01:57:34 -05:00
| `state_event` | string | no | The state event of an issue. Set `close` to close the issue and `reopen` to reopen it |
2020-09-30 20:10:16 -04:00
| `title` | string | no | The title of an issue |
| `updated_at` | string | no | When the issue was updated. Date time string, ISO 8601 formatted, for example `2016-03-11T03:45:40Z` (requires administrator or project owner rights). Empty string or null values are not accepted.|
2021-05-04 08:10:04 -04:00
| `weight` ** (PREMIUM)** | integer | no | The weight of the issue. Valid values are greater than or equal to 0. 0 |
2017-08-31 06:38:32 -04:00
2020-01-30 10:09:15 -05:00
```shell
2020-05-27 20:08:37 -04:00
curl --request PUT --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/projects/4/issues/85?state_event=close"
2016-01-18 03:10:46 -05:00
```
2012-07-24 08:25:01 -04:00
2016-01-18 03:10:46 -05:00
Example response:
2013-02-27 08:36:20 -05:00
2016-01-18 03:10:46 -05:00
```json
{
"created_at" : "2016-01-07T12:46:01.410Z",
"author" : {
"name" : "Alexandra Bashirian",
"avatar_url" : null,
"username" : "eileen.lowe",
"id" : 18,
"state" : "active",
2016-10-13 07:24:09 -04:00
"web_url" : "https://gitlab.example.com/eileen.lowe"
2016-01-18 03:10:46 -05:00
},
"state" : "closed",
"title" : "Issues with auth",
"project_id" : 4,
"description" : null,
"updated_at" : "2016-01-07T12:55:16.213Z",
2017-09-16 05:51:02 -04:00
"closed_at" : "2016-01-08T12:55:16.213Z",
2018-02-27 12:21:37 -05:00
"closed_by" : {
"state" : "active",
"web_url" : "https://gitlab.example.com/root",
"avatar_url" : null,
"username" : "root",
"id" : 1,
"name" : "Administrator"
},
2016-01-18 03:10:46 -05:00
"iid" : 15,
"labels" : [
"bug"
],
2019-01-24 12:48:51 -05:00
"upvotes": 4,
"downvotes": 0,
2019-02-19 06:30:07 -05:00
"merge_requests_count": 0,
2016-01-18 03:10:46 -05:00
"id" : 85,
2017-05-04 08:11:15 -04:00
"assignees" : [],
2016-01-18 03:10:46 -05:00
"assignee" : null,
2016-04-08 02:41:10 -04:00
"milestone" : null,
2016-02-23 16:59:32 -05:00
"subscribed" : true,
2016-07-12 11:59:21 -04:00
"user_notes_count": 0,
2016-08-02 13:37:04 -04:00
"due_date": "2016-07-22",
2020-08-12 08:10:25 -04:00
"web_url": "http://gitlab.example.com/my-group/my-project/issues/15",
2019-12-27 10:08:16 -05:00
"references": {
"short": "#15",
"relative": "#15",
"full": "my-group/my-project#15"
},
2017-08-19 13:49:39 -04:00
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
2017-07-25 05:35:45 -04:00
"confidential": false,
2017-08-31 06:38:32 -04:00
"discussion_locked": false,
2021-05-05 14:10:31 -04:00
"issue_type": "issue",
2017-07-25 05:35:45 -04:00
"_links": {
2020-08-12 08:10:25 -04:00
"self": "http://gitlab.example.com/api/v4/projects/1/issues/2",
"notes": "http://gitlab.example.com/api/v4/projects/1/issues/2/notes",
"award_emoji": "http://gitlab.example.com/api/v4/projects/1/issues/2/award_emoji",
"project": "http://gitlab.example.com/api/v4/projects/1"
2019-06-07 05:15:55 -04:00
},
"task_completion_status":{
"count":0,
"completed_count":0
2017-07-25 05:35:45 -04:00
}
2016-01-18 03:10:46 -05:00
}
```
2014-08-14 04:17:52 -04:00
2021-05-04 08:10:04 -04:00
Issues created by users on GitLab Premium or higher include the `weight` property:
2019-07-03 05:32:54 -04:00
```json
{
"project_id" : 4,
"description" : null,
"weight": null,
...
}
```
2021-05-04 08:10:04 -04:00
Issues created by users on GitLab Premium or higher include the `epic` property:
```json
{
"project_id" : 4,
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"epic_iid" : 5, //deprecated, use `iid` of the `epic` attribute
"epic": {
"id" : 42,
"iid" : 5,
"title": "My epic epic",
"url" : "/groups/h5bp/-/epics/5",
"group_id": 8
},
...
}
```
Issues created by users on GitLab Ultimate include the `health_status` property:
2020-08-13 11:10:03 -04:00
```json
[
{
"project_id" : 4,
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"health_status": "on_track",
...
}
]
```
2020-12-04 16:09:29 -05:00
NOTE:
2021-09-15 20:11:46 -04:00
The `closed_by` attribute was [introduced ](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042 ) in GitLab 10.6. This value is only present for issues closed after GitLab 10.6 and if the user account that closed
2020-08-20 23:10:16 -04:00
the issue still exists.
2018-03-03 05:37:13 -05:00
2021-05-04 08:10:04 -04:00
WARNING:
2021-09-15 20:11:46 -04:00
The `epic_iid` attribute is deprecated and [scheduled for removal ](https://gitlab.com/gitlab-org/gitlab/-/issues/35157 ) in API version 5.
2021-05-04 08:10:04 -04:00
Please use `iid` of the `epic` attribute instead.
2020-12-07 19:09:45 -05:00
WARNING:
2020-09-30 20:10:16 -04:00
`assignee` column is deprecated. We now show it as a single-sized array `assignees` to conform to the GitLab EE API.
2016-03-21 09:12:52 -04:00
## Delete an issue
2013-02-27 08:36:20 -05:00
2020-12-17 19:10:04 -05:00
Only for administrators and project owners. Deletes an issue.
2013-02-27 08:36:20 -05:00
2020-02-27 04:09:01 -05:00
```plaintext
2017-03-01 01:57:34 -05:00
DELETE /projects/:id/issues/:issue_iid
2013-02-27 08:36:20 -05:00
```
2017-03-01 01:57:34 -05:00
| Attribute | Type | Required | Description |
2017-04-06 11:18:51 -04:00
|-------------|---------|----------|--------------------------------------|
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2017-03-01 01:57:34 -05:00
| `issue_iid` | integer | yes | The internal ID of a project's issue |
2016-02-26 03:55:43 -05:00
2020-01-30 10:09:15 -05:00
```shell
2020-05-27 20:08:37 -04:00
curl --request DELETE --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/projects/4/issues/85"
2016-02-26 03:55:43 -05:00
```
2020-06-30 11:08:48 -04:00
## Reorder an issue
2020-08-13 05:10:09 -04:00
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/211864) in GitLab 13.2.
2020-07-14 14:09:55 -04:00
2020-06-30 11:08:48 -04:00
Reorders an issue, you can see the results when sorting issues manually
```plaintext
PUT /projects/:id/issues/:issue_iid/reorder
```
| Attribute | Type | Required | Description |
|-------------|---------|----------|--------------------------------------|
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2020-09-10 08:08:54 -04:00
| `issue_iid` | integer | yes | The internal ID of the project's issue |
| `move_after_id` | integer | no | The ID of a project's issue that should be placed after this issue |
| `move_before_id` | integer | no | The ID of a project's issue that should be placed before this issue |
2020-06-30 11:08:48 -04:00
```shell
curl --request PUT --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/projects/4/issues/85/reorder?move_after_id=51& move_before_id=92"
```
2016-04-07 08:07:17 -04:00
## Move an issue
2016-11-24 12:28:52 -05:00
Moves an issue to a different project. If the target project
2020-12-17 19:10:04 -05:00
is the source project or the user has insufficient permissions,
an error message with status code `400` is returned.
2016-04-07 08:07:17 -04:00
2020-08-20 23:10:16 -04:00
If a given label or milestone with the same name also exists in the target
project, it's then assigned to the issue being moved.
2016-05-06 06:52:04 -04:00
2020-02-27 04:09:01 -05:00
```plaintext
2017-03-01 01:57:34 -05:00
POST /projects/:id/issues/:issue_iid/move
2016-04-07 08:07:17 -04:00
```
2017-03-01 01:57:34 -05:00
| Attribute | Type | Required | Description |
2017-04-06 11:18:51 -04:00
|-----------------|---------|----------|--------------------------------------|
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2017-03-01 01:57:34 -05:00
| `issue_iid` | integer | yes | The internal ID of a project's issue |
| `to_project_id` | integer | yes | The ID of the new project |
2016-04-07 08:07:17 -04:00
2020-01-30 10:09:15 -05:00
```shell
2020-05-27 20:08:37 -04:00
curl --header "PRIVATE-TOKEN: < your_access_token > " --form to_project_id=5 "https://gitlab.example.com/api/v4/projects/4/issues/85/move"
2016-04-07 08:07:17 -04:00
```
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",
2017-09-16 05:51:02 -04:00
"closed_at": null,
2018-02-27 12:21:37 -05:00
"closed_by": null,
2016-04-07 08:07:17 -04:00
"labels": [],
2019-01-24 12:48:51 -05:00
"upvotes": 4,
"downvotes": 0,
2019-02-19 06:30:07 -05:00
"merge_requests_count": 0,
2016-04-07 08:07:17 -04:00
"milestone": null,
2017-05-04 08:11:15 -04:00
"assignees": [{
"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"
}],
2016-04-07 08:07:17 -04:00
"assignee": {
"name": "Miss Monserrate Beier",
"username": "axel.block",
"id": 12,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80& d=identicon",
2016-10-13 07:24:09 -04:00
"web_url": "https://gitlab.example.com/axel.block"
2016-04-07 08:07:17 -04:00
},
2021-05-05 08:10:33 -04:00
"type" : "ISSUE",
2016-04-07 08:07:17 -04:00
"author": {
"name": "Kris Steuber",
"username": "solon.cremin",
"id": 10,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/7a190fecbaa68212a4b68aeb6e3acd10?s=80& d=identicon",
2016-10-13 07:24:09 -04:00
"web_url": "https://gitlab.example.com/solon.cremin"
2016-07-12 11:59:21 -04:00
},
2016-08-02 13:37:04 -04:00
"due_date": null,
2020-08-12 08:10:25 -04:00
"web_url": "http://gitlab.example.com/my-group/my-project/issues/11",
2019-12-27 10:08:16 -05:00
"references": {
"short": "#11",
"relative": "#11",
"full": "my-group/my-project#11"
},
2017-08-19 13:49:39 -04:00
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
2017-07-25 05:35:45 -04:00
"confidential": false,
2017-08-31 06:38:32 -04:00
"discussion_locked": false,
2021-05-05 14:10:31 -04:00
"issue_type": "issue",
2017-07-25 05:35:45 -04:00
"_links": {
2020-08-12 08:10:25 -04:00
"self": "http://gitlab.example.com/api/v4/projects/1/issues/2",
"notes": "http://gitlab.example.com/api/v4/projects/1/issues/2/notes",
"award_emoji": "http://gitlab.example.com/api/v4/projects/1/issues/2/award_emoji",
"project": "http://gitlab.example.com/api/v4/projects/1"
2019-06-07 05:15:55 -04:00
},
"task_completion_status":{
"count":0,
"completed_count":0
2017-07-25 05:35:45 -04:00
}
2016-04-07 08:07:17 -04:00
}
```
2021-05-04 08:10:04 -04:00
Issues created by users on GitLab Premium or higher include the `weight` property:
2019-07-03 05:32:54 -04:00
```json
{
"project_id": 5,
"description": "Repellat voluptas quibusdam voluptatem exercitationem.",
"weight": null,
...
}
```
2021-05-04 08:10:04 -04:00
Issues created by users on GitLab Premium or higher include the `epic` property:
```json
{
"project_id" : 4,
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"epic_iid" : 5, //deprecated, use `iid` of the `epic` attribute
"epic": {
"id" : 42,
"iid" : 5,
"title": "My epic epic",
"url" : "/groups/h5bp/-/epics/5",
"group_id": 8
},
...
}
```
Issues created by users on GitLab Ultimate include the `health_status` property:
2020-08-13 11:10:03 -04:00
```json
[
{
"project_id" : 4,
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"health_status": "on_track",
...
}
]
```
2020-12-07 19:09:45 -05:00
WARNING:
2020-08-20 23:10:16 -04:00
The `assignee` column is deprecated. We now show it as a single-sized array `assignees` to conform to the GitLab EE API.
2017-05-04 08:11:15 -04:00
2021-05-04 08:10:04 -04:00
WARNING:
2021-09-15 20:11:46 -04:00
The `epic_iid` attribute is deprecated and [scheduled for removal ](https://gitlab.com/gitlab-org/gitlab/-/issues/35157 ) in API version 5.
2021-05-04 08:10:04 -04:00
Please use `iid` of the `epic` attribute instead.
2020-12-04 16:09:29 -05:00
NOTE:
2021-09-15 20:11:46 -04:00
The `closed_by` attribute was [introduced ](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042 ) in GitLab 10.6. This value is only present for issues closed after GitLab 10.6 and if the user account that closed
2020-08-20 23:10:16 -04:00
the issue still exists.
2018-03-03 05:37:13 -05:00
2021-09-20 23:11:06 -04:00
## Clone an issue
Clone the issue to given project. If the user has insufficient permissions,
an error message with status code `400` is returned.
Copies as much data as possible as long as the target project contains equivalent labels, milestones,
and so on.
```plaintext
POST /projects/:id/issues/:issue_iid/clone
```
| Attribute | Type | Required | Description |
| --------------- | -------------- | ---------------------- | --------------------------------- |
| `id` | integer/string | ** {check-circle}** Yes | ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user. |
| `issue_iid` | integer | ** {check-circle}** Yes | Internal ID of a project's issue. |
| `to_project_id` | integer | ** {check-circle}** Yes | ID of the new project. |
| `with_notes` | boolean | ** {dotted-circle}** No | Clone the issue with [notes ](notes.md ). Default is `false` . |
```shell
curl --request POST \
--header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/projects/5/issues/1/clone?with_notes=true& to_project_id=6"
```
Example response:
```json
{
"id":290,
"iid":1,
"project_id":143,
"title":"foo",
"description":"closed",
"state":"opened",
"created_at":"2021-09-14T22:24:11.696Z",
"updated_at":"2021-09-14T22:24:11.696Z",
"closed_at":null,
"closed_by":null,
"labels":[
],
"milestone":null,
"assignees":[
{
"id":179,
"name":"John Doe2",
"username":"john",
"state":"active",
"avatar_url":"https://www.gravatar.com/avatar/10fc7f102be8de7657fb4d80898bbfe3?s=80\u0026d=identicon",
"web_url":"https://gitlab.example.com/john"
}
],
"author":{
"id":179,
"name":"John Doe2",
"username":"john",
"state":"active",
"avatar_url":"https://www.gravatar.com/avatar/10fc7f102be8de7657fb4d80898bbfe3?s=80\u0026d=identicon",
"web_url":"https://gitlab.example.com/john"
},
"type":"ISSUE",
"assignee":{
"id":179,
"name":"John Doe2",
"username":"john",
"state":"active",
"avatar_url":"https://www.gravatar.com/avatar/10fc7f102be8de7657fb4d80898bbfe3?s=80\u0026d=identicon",
"web_url":"https://gitlab.example.com/john"
},
"user_notes_count":1,
"merge_requests_count":0,
"upvotes":0,
"downvotes":0,
"due_date":null,
"confidential":false,
"discussion_locked":null,
"issue_type":"issue",
"web_url":"https://gitlab.example.com/namespace1/project2/-/issues/1",
"time_stats":{
"time_estimate":0,
"total_time_spent":0,
"human_time_estimate":null,
"human_total_time_spent":null
},
"task_completion_status":{
"count":0,
"completed_count":0
},
"blocking_issues_count":0,
"has_tasks":false,
"_links":{
"self":"https://gitlab.example.com/api/v4/projects/143/issues/1",
"notes":"https://gitlab.example.com/api/v4/projects/143/issues/1/notes",
"award_emoji":"https://gitlab.example.com/api/v4/projects/143/issues/1/award_emoji",
"project":"https://gitlab.example.com/api/v4/projects/143"
},
"references":{
"short":"#1",
"relative":"#1",
"full":"namespace1/project2#1"
},
"subscribed":true,
"moved_to_id":null,
"service_desk_reply_to":null
}
```
2016-04-08 08:17:42 -04:00
## Subscribe to an issue
2016-10-26 17:21:50 -04:00
Subscribes the authenticated user to an issue to receive notifications.
2016-11-24 12:28:52 -05:00
If the user is already subscribed to the issue, the status code `304`
is returned.
2016-04-08 08:17:42 -04:00
2020-02-27 04:09:01 -05:00
```plaintext
2017-03-01 01:57:34 -05:00
POST /projects/:id/issues/:issue_iid/subscribe
2016-04-08 08:17:42 -04:00
```
2017-03-01 01:57:34 -05:00
| Attribute | Type | Required | Description |
2017-04-06 11:18:51 -04:00
|-------------|---------|----------|--------------------------------------|
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2017-03-01 01:57:34 -05:00
| `issue_iid` | integer | yes | The internal ID of a project's issue |
2016-04-08 08:17:42 -04:00
2020-01-30 10:09:15 -05:00
```shell
2020-05-27 20:08:37 -04:00
curl --request POST --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/projects/5/issues/93/subscribe"
2016-04-08 08:17:42 -04:00
```
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",
2017-09-16 05:51:02 -04:00
"closed_at": null,
2018-02-27 12:21:37 -05:00
"closed_by": null,
2016-04-08 08:17:42 -04:00
"labels": [],
2019-01-24 12:48:51 -05:00
"upvotes": 4,
"downvotes": 0,
2019-02-19 06:30:07 -05:00
"merge_requests_count": 0,
2016-04-08 08:17:42 -04:00
"milestone": null,
2017-05-04 08:11:15 -04:00
"assignees": [{
"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"
}],
2016-04-08 08:17:42 -04:00
"assignee": {
"name": "Miss Monserrate Beier",
"username": "axel.block",
"id": 12,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80& d=identicon",
2016-10-13 07:24:09 -04:00
"web_url": "https://gitlab.example.com/axel.block"
2016-04-08 08:17:42 -04:00
},
2021-05-05 08:10:33 -04:00
"type" : "ISSUE",
2016-04-08 08:17:42 -04:00
"author": {
"name": "Kris Steuber",
"username": "solon.cremin",
"id": 10,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/7a190fecbaa68212a4b68aeb6e3acd10?s=80& d=identicon",
2016-10-13 07:24:09 -04:00
"web_url": "https://gitlab.example.com/solon.cremin"
2016-07-12 11:59:21 -04:00
},
2016-08-02 13:37:04 -04:00
"due_date": null,
2020-08-12 08:10:25 -04:00
"web_url": "http://gitlab.example.com/my-group/my-project/issues/11",
2019-12-27 10:08:16 -05:00
"references": {
"short": "#11",
"relative": "#11",
"full": "my-group/my-project#11"
},
2017-08-19 13:49:39 -04:00
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
2017-07-25 05:35:45 -04:00
"confidential": false,
2017-08-31 06:38:32 -04:00
"discussion_locked": false,
2021-05-05 14:10:31 -04:00
"issue_type": "issue",
2017-07-25 05:35:45 -04:00
"_links": {
2020-08-12 08:10:25 -04:00
"self": "http://gitlab.example.com/api/v4/projects/1/issues/2",
"notes": "http://gitlab.example.com/api/v4/projects/1/issues/2/notes",
"award_emoji": "http://gitlab.example.com/api/v4/projects/1/issues/2/award_emoji",
"project": "http://gitlab.example.com/api/v4/projects/1"
2019-06-07 05:15:55 -04:00
},
"task_completion_status":{
"count":0,
"completed_count":0
2017-07-25 05:35:45 -04:00
}
2016-04-08 08:17:42 -04:00
}
```
2021-05-04 08:10:04 -04:00
Issues created by users on GitLab Premium or higher include the `weight` property:
2019-07-03 05:32:54 -04:00
```json
{
"project_id": 5,
"description": "Repellat voluptas quibusdam voluptatem exercitationem.",
"weight": null,
...
}
```
2021-05-04 08:10:04 -04:00
Issues created by users on GitLab Premium or higher include the `epic` property:
```json
{
"project_id" : 4,
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"epic_iid" : 5, //deprecated, use `iid` of the `epic` attribute
"epic": {
"id" : 42,
"iid" : 5,
"title": "My epic epic",
"url" : "/groups/h5bp/-/epics/5",
"group_id": 8
},
...
}
```
Issues created by users on GitLab Ultimate include the `health_status` property:
```json
[
{
"project_id" : 4,
"description" : "Omnis vero earum sunt corporis dolor et placeat.",
"health_status": "on_track",
...
}
]
```
2020-12-07 19:09:45 -05:00
WARNING:
2020-08-20 23:10:16 -04:00
The `assignee` column is deprecated. We now show it as a single-sized array `assignees` to conform to the GitLab EE API.
2017-05-04 08:11:15 -04:00
2021-05-04 08:10:04 -04:00
WARNING:
2021-09-15 20:11:46 -04:00
The `epic_iid` attribute is deprecated and [scheduled for removal ](https://gitlab.com/gitlab-org/gitlab/-/issues/35157 ) in API version 5.
2021-05-04 08:10:04 -04:00
Please use `iid` of the `epic` attribute instead.
2020-12-04 16:09:29 -05:00
NOTE:
2021-09-15 20:11:46 -04:00
The `closed_by` attribute was [introduced ](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042 ) in GitLab 10.6. This value is only present for issues closed after GitLab 10.6 and if the user account that closed
2020-08-20 23:10:16 -04:00
the issue still exists.
2018-03-03 05:37:13 -05:00
2016-04-08 08:17:42 -04:00
## Unsubscribe from an issue
2016-04-12 08:46:59 -04:00
Unsubscribes the authenticated user from the issue to not receive notifications
2016-11-24 12:28:52 -05:00
from it. If the user is not subscribed to the issue, the
status code `304` is returned.
2016-04-08 08:17:42 -04:00
2020-02-27 04:09:01 -05:00
```plaintext
2017-03-01 01:57:34 -05:00
POST /projects/:id/issues/:issue_iid/unsubscribe
2016-04-08 08:17:42 -04:00
```
2017-03-01 01:57:34 -05:00
| Attribute | Type | Required | Description |
2017-04-06 11:18:51 -04:00
|-------------|---------|----------|--------------------------------------|
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2017-03-01 01:57:34 -05:00
| `issue_iid` | integer | yes | The internal ID of a project's issue |
2016-04-08 08:17:42 -04:00
2020-01-30 10:09:15 -05:00
```shell
2020-05-27 20:08:37 -04:00
curl --request POST --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/projects/5/issues/93/unsubscribe"
2016-04-08 08:17:42 -04:00
```
2017-08-31 06:38:32 -04:00
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": [],
2019-01-24 12:48:51 -05:00
"upvotes": 4,
"downvotes": 0,
2019-02-19 06:30:07 -05:00
"merge_requests_count": 0,
2017-08-31 06:38:32 -04:00
"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"
},
2021-05-05 08:10:33 -04:00
"type" : "ISSUE",
2018-03-06 11:16:51 -05:00
"closed_at": null,
"closed_by": null,
2017-08-31 06:38:32 -04:00
"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,
2020-08-12 08:10:25 -04:00
"web_url": "http://gitlab.example.com/my-group/my-project/issues/12",
2019-12-27 10:08:16 -05:00
"references": {
"short": "#12",
"relative": "#12",
"full": "my-group/my-project#12"
},
2017-08-31 06:38:32 -04:00
"confidential": false,
2019-06-07 05:15:55 -04:00
"discussion_locked": false,
2021-05-05 14:10:31 -04:00
"issue_type": "issue",
2019-06-07 05:15:55 -04:00
"task_completion_status":{
"count":0,
"completed_count":0
}
2017-08-31 06:38:32 -04:00
}
```
2020-10-28 14:08:52 -04:00
## Create a to-do item
2016-06-28 12:04:44 -04:00
2020-10-28 14:08:52 -04:00
Manually creates a to-do item for the current user on an issue. If
there already exists a to-do item for the user on that issue, status code `304` is
2016-06-28 12:04:44 -04:00
returned.
2020-02-27 04:09:01 -05:00
```plaintext
2017-03-01 01:57:34 -05:00
POST /projects/:id/issues/:issue_iid/todo
2016-06-28 12:04:44 -04:00
```
2017-03-01 01:57:34 -05:00
| Attribute | Type | Required | Description |
2017-04-06 11:18:51 -04:00
|-------------|---------|----------|--------------------------------------|
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2017-03-01 01:57:34 -05:00
| `issue_iid` | integer | yes | The internal ID of a project's issue |
2016-06-28 12:04:44 -04:00
2020-01-30 10:09:15 -05:00
```shell
2020-05-27 20:08:37 -04:00
curl --request POST --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/projects/5/issues/93/todo"
2016-06-28 12:04:44 -04:00
```
Example response:
```json
{
"id": 112,
"project": {
"id": 5,
2020-03-26 23:07:56 -04:00
"name": "GitLab CI/CD",
"name_with_namespace": "GitLab Org / GitLab CI/CD",
2016-06-28 12:04:44 -04:00
"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",
2016-10-13 07:24:09 -04:00
"web_url": "https://gitlab.example.com/root"
2016-06-28 12:04:44 -04:00
},
"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
},
2017-05-04 08:11:15 -04:00
"assignees": [{
"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"
}],
2016-06-28 12:04:44 -04:00
"assignee": {
"name": "Jarret O'Keefe",
"username": "francisca",
"id": 14,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/a7fa515d53450023c83d62986d0658a8?s=80& d=identicon",
2016-10-13 07:24:09 -04:00
"web_url": "https://gitlab.example.com/francisca"
2016-06-28 12:04:44 -04:00
},
2021-05-05 08:10:33 -04:00
"type" : "ISSUE",
2016-06-28 12:04:44 -04:00
"author": {
"name": "Maxie Medhurst",
"username": "craig_rutherford",
"id": 12,
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/a0d477b3ea21970ce6ffcbb817b0b435?s=80& d=identicon",
2016-10-13 07:24:09 -04:00
"web_url": "https://gitlab.example.com/craig_rutherford"
2016-06-28 12:04:44 -04:00
},
"subscribed": true,
"user_notes_count": 7,
"upvotes": 0,
2016-08-02 13:37:04 -04:00
"downvotes": 0,
2019-02-19 06:30:07 -05:00
"merge_requests_count": 0,
2016-08-02 13:37:04 -04:00
"due_date": null,
2020-08-12 08:10:25 -04:00
"web_url": "http://gitlab.example.com/my-group/my-project/issues/10",
2019-12-27 10:08:16 -05:00
"references": {
"short": "#10",
"relative": "#10",
"full": "my-group/my-project#10"
},
2017-08-31 06:38:32 -04:00
"confidential": false,
2019-06-07 05:15:55 -04:00
"discussion_locked": false,
2021-05-05 14:10:31 -04:00
"issue_type": "issue",
2019-06-07 05:15:55 -04:00
"task_completion_status":{
"count":0,
"completed_count":0
}
2016-06-28 12:04:44 -04:00
},
"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"
}
```
2020-12-07 19:09:45 -05:00
WARNING:
2020-08-20 23:10:16 -04:00
The `assignee` column is deprecated. We now show it as a single-sized array `assignees` to conform to the GitLab EE API.
2017-05-04 08:11:15 -04:00
2020-12-04 16:09:29 -05:00
NOTE:
2021-09-15 20:11:46 -04:00
The `closed_by` attribute was [introduced ](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17042 ) in GitLab 10.6. This value is only present for issues closed after GitLab 10.6 and if the user account that closed
2020-08-20 23:10:16 -04:00
the issue still exists.
2018-03-03 05:37:13 -05:00
2020-12-04 07:09:39 -05:00
## Promote an issue to an epic **(PREMIUM)**
Promotes an issue to an epic by adding a comment with the `/promote`
[quick action ](../user/project/quick_actions.md ).
To learn more about promoting issues to epics, visit [Manage epics ](../user/group/epics/manage_epics.md#promote-an-issue-to-an-epic ).
```plaintext
POST /projects/:id/issues/:issue_iid/notes
```
Supported attributes:
| Attribute | Type | Required | Description |
| :---------- | :------------- | :------- | :---------- |
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2020-12-04 07:09:39 -05:00
| `issue_iid` | integer | yes | The internal ID of a project's issue |
| `body` | String | yes | The content of a note. Must contain `/promote` at the start of a new line. |
Example request:
```shell
2020-12-08 04:09:41 -05:00
curl --request POST --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/projects/5/issues/11/notes?body=Lets%20promote%20this%20to%20an%20epic%0A%0A%2Fpromote"
2020-12-04 07:09:39 -05:00
```
Example response:
```json
2020-12-08 04:09:41 -05:00
{
2020-12-04 07:09:39 -05:00
"id":699,
"type":null,
"body":"Lets promote this to an epic",
"attachment":null,
"author": {
"id":1,
"name":"Alexandra Bashirian",
"username":"eileen.lowe",
"state":"active",
"avatar_url":"https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80& d=identicon",
"web_url":"https://gitlab.example.com/eileen.lowe"
},
"created_at":"2020-12-03T12:27:17.844Z",
"updated_at":"2020-12-03T12:27:17.844Z",
"system":false,
"noteable_id":461,
"noteable_type":"Issue",
"resolvable":false,
"confidential":false,
"noteable_iid":33,
"commands_changes": {
"promote_to_epic":true
}
}
```
2017-01-18 11:48:16 -05:00
## Set a time estimate for an issue
Sets an estimated time of work for this issue.
2020-02-27 04:09:01 -05:00
```plaintext
2017-03-01 01:57:34 -05:00
POST /projects/:id/issues/:issue_iid/time_estimate
2017-01-18 11:48:16 -05:00
```
2017-03-01 01:57:34 -05:00
| Attribute | Type | Required | Description |
2017-04-06 11:18:51 -04:00
|-------------|---------|----------|------------------------------------------|
2020-09-30 20:10:16 -04:00
| `duration` | string | yes | The duration in human format. e.g: 3h30m |
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2017-03-01 01:57:34 -05:00
| `issue_iid` | integer | yes | The internal ID of a project's issue |
2017-01-18 11:48:16 -05:00
2020-01-30 10:09:15 -05:00
```shell
2020-05-27 20:08:37 -04:00
curl --request POST --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/projects/5/issues/93/time_estimate?duration=3h30m"
2017-01-18 11:48:16 -05:00
```
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.
2020-02-27 04:09:01 -05:00
```plaintext
2017-03-01 01:57:34 -05:00
POST /projects/:id/issues/:issue_iid/reset_time_estimate
2017-01-18 11:48:16 -05:00
```
2017-03-01 01:57:34 -05:00
| Attribute | Type | Required | Description |
2017-04-06 11:18:51 -04:00
|-------------|---------|----------|--------------------------------------|
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2017-03-01 01:57:34 -05:00
| `issue_iid` | integer | yes | The internal ID of a project's issue |
2017-01-18 11:48:16 -05:00
2020-01-30 10:09:15 -05:00
```shell
2020-05-27 20:08:37 -04:00
curl --request POST --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/projects/5/issues/93/reset_time_estimate"
2017-01-18 11:48:16 -05:00
```
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
2020-02-27 04:09:01 -05:00
```plaintext
2017-03-01 01:57:34 -05:00
POST /projects/:id/issues/:issue_iid/add_spent_time
2017-01-18 11:48:16 -05:00
```
2017-03-01 01:57:34 -05:00
| Attribute | Type | Required | Description |
2017-04-06 11:18:51 -04:00
|-------------|---------|----------|------------------------------------------|
2020-09-30 20:10:16 -04:00
| `duration` | string | yes | The duration in human format. e.g: 3h30m |
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2017-03-01 01:57:34 -05:00
| `issue_iid` | integer | yes | The internal ID of a project's issue |
2021-07-27 05:10:08 -04:00
| `summary` | string | no | A summary of how the time was spent |
2017-01-18 11:48:16 -05:00
2020-01-30 10:09:15 -05:00
```shell
2020-05-27 20:08:37 -04:00
curl --request POST --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/projects/5/issues/93/add_spent_time?duration=1h"
2017-01-18 11:48:16 -05:00
```
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.
2020-02-27 04:09:01 -05:00
```plaintext
2017-03-01 01:57:34 -05:00
POST /projects/:id/issues/:issue_iid/reset_spent_time
2017-01-18 11:48:16 -05:00
```
2017-03-01 01:57:34 -05:00
| Attribute | Type | Required | Description |
2017-04-06 11:18:51 -04:00
|-------------|---------|----------|--------------------------------------|
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2017-03-01 01:57:34 -05:00
| `issue_iid` | integer | yes | The internal ID of a project's issue |
2017-01-18 11:48:16 -05:00
2020-01-30 10:09:15 -05:00
```shell
2020-05-27 20:08:37 -04:00
curl --request POST --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/projects/5/issues/93/reset_spent_time"
2017-01-18 11:48:16 -05:00
```
Example response:
```json
{
"human_time_estimate": null,
"human_total_time_spent": null,
"time_estimate": 0,
"total_time_spent": 0
}
```
## Get time tracking stats
2020-08-20 23:10:16 -04:00
If the project is private or the issue is confidential, you need to provide credentials to authorize.
2020-06-22 08:08:47 -04:00
The preferred way to do this, is by using [personal access tokens ](../user/profile/personal_access_tokens.md ).
2020-02-27 04:09:01 -05:00
```plaintext
2017-03-01 01:57:34 -05:00
GET /projects/:id/issues/:issue_iid/time_stats
2017-01-18 11:48:16 -05:00
```
2017-03-01 01:57:34 -05:00
| Attribute | Type | Required | Description |
2017-04-06 11:18:51 -04:00
|-------------|---------|----------|--------------------------------------|
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2017-03-01 01:57:34 -05:00
| `issue_iid` | integer | yes | The internal ID of a project's issue |
2017-01-18 11:48:16 -05:00
2020-01-30 10:09:15 -05:00
```shell
2020-05-27 20:08:37 -04:00
curl --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/projects/5/issues/93/time_stats"
2017-01-18 11:48:16 -05:00
```
Example response:
```json
{
"human_time_estimate": "2h",
"human_total_time_spent": "1h",
"time_estimate": 7200,
"total_time_spent": 3600
}
```
2018-09-19 04:06:03 -04:00
## List merge requests related to issue
Get all the merge requests that are related to the issue.
2020-08-20 23:10:16 -04:00
If the project is private or the issue is confidential, you need to provide credentials to authorize.
2020-06-22 08:08:47 -04:00
The preferred way to do this, is by using [personal access tokens ](../user/profile/personal_access_tokens.md ).
2020-02-27 04:09:01 -05:00
```plaintext
2021-05-05 14:10:31 -04:00
GET /projects/:id/issues/:issue_iid/related_merge_requests
2018-09-19 04:06:03 -04:00
```
| Attribute | Type | Required | Description |
|-------------|---------|----------|--------------------------------------|
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2018-09-19 04:06:03 -04:00
| `issue_iid` | integer | yes | The internal ID of a project's issue |
2020-01-30 10:09:15 -05:00
```shell
2020-05-27 20:08:37 -04:00
curl --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/projects/1/issues/11/related_merge_requests"
2018-09-19 04:06:03 -04:00
```
Example response:
```json
[
{
"id": 29,
"iid": 11,
"project_id": 1,
"title": "Provident eius eos blanditiis consequatur neque odit.",
"description": "Ut consequatur ipsa aspernatur quisquam voluptatum fugit. Qui harum corporis quo fuga ut incidunt veritatis. Autem necessitatibus et harum occaecati nihil ea.\r\n\r\ntwitter/flight#8",
"state": "opened",
"created_at": "2018-09-18T14:36:15.510Z",
"updated_at": "2018-09-19T07:45:13.089Z",
2019-10-01 05:10:39 -04:00
"closed_by": null,
"closed_at": null,
2018-09-19 04:06:03 -04:00
"target_branch": "v2.x",
"source_branch": "so_long_jquery",
2019-10-01 05:10:39 -04:00
"user_notes_count": 9,
2018-09-19 04:06:03 -04:00
"upvotes": 0,
"downvotes": 0,
"author": {
"id": 14,
"name": "Verna Hills",
"username": "lawanda_reinger",
"state": "active",
"avatar_url": "https://www.gravatar.com/avatar/de68a91aeab1cff563795fb98a0c2cc0?s=80& d=identicon",
"web_url": "https://gitlab.example.com/lawanda_reinger"
},
"assignee": {
"id": 19,
"name": "Jody Baumbach",
"username": "felipa.kuvalis",
"state": "active",
"avatar_url": "https://www.gravatar.com/avatar/6541fc75fc4e87e203529bd275fafd07?s=80& d=identicon",
"web_url": "https://gitlab.example.com/felipa.kuvalis"
},
"source_project_id": 1,
"target_project_id": 1,
"labels": [],
2021-06-09 23:10:01 -04:00
"draft": false,
2018-09-19 04:06:03 -04:00
"work_in_progress": false,
"milestone": {
"id": 27,
"iid": 2,
"project_id": 1,
"title": "v1.0",
"description": "Et tenetur voluptatem minima doloribus vero dignissimos vitae.",
"state": "active",
"created_at": "2018-09-18T14:35:44.353Z",
"updated_at": "2018-09-18T14:35:44.353Z",
"due_date": null,
"start_date": null,
"web_url": "https://gitlab.example.com/twitter/flight/milestones/2"
},
"merge_when_pipeline_succeeds": false,
"merge_status": "cannot_be_merged",
"sha": "3b7b528e9353295c1c125dad281ac5b5deae5f12",
"merge_commit_sha": null,
2019-11-05 16:07:46 -05:00
"squash_commit_sha": null,
2018-09-19 04:06:03 -04:00
"discussion_locked": null,
"should_remove_source_branch": null,
"force_remove_source_branch": false,
2019-10-01 05:10:39 -04:00
"reference": "!11",
2018-09-19 04:06:03 -04:00
"web_url": "https://gitlab.example.com/twitter/flight/merge_requests/4",
2019-12-27 10:08:16 -05:00
"references": {
"short": "!4",
"relative": "!4",
"full": "twitter/flight!4"
},
2018-09-19 04:06:03 -04:00
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
2019-10-01 05:10:39 -04:00
"squash": false,
"task_completion_status": {
"count": 0,
"completed_count": 0
},
"changes_count": "10",
"latest_build_started_at": "2018-12-05T01:16:41.723Z",
"latest_build_finished_at": "2018-12-05T02:35:54.046Z",
"first_deployed_to_production_at": null,
"pipeline": {
"id": 38980952,
"sha": "81c6a84c7aebd45a1ac2c654aa87f11e32338e0a",
"ref": "test-branch",
"status": "success",
"web_url": "https://gitlab.com/gitlab-org/gitlab/pipelines/38980952"
},
"head_pipeline": {
"id": 38980952,
"sha": "81c6a84c7aebd45a1ac2c654aa87f11e32338e0a",
"ref": "test-branch",
"status": "success",
"web_url": "https://gitlab.example.com/twitter/flight/pipelines/38980952",
"before_sha": "3c738a37eb23cf4c0ed0d45d6ddde8aad4a8da51",
"tag": false,
"yaml_errors": null,
"user": {
"id": 19,
"name": "Jody Baumbach",
"username": "felipa.kuvalis",
"state": "active",
"avatar_url": "https://www.gravatar.com/avatar/6541fc75fc4e87e203529bd275fafd07?s=80& d=identicon",
"web_url": "https://gitlab.example.com/felipa.kuvalis"
},
"created_at": "2018-12-05T01:16:13.342Z",
"updated_at": "2018-12-05T02:35:54.086Z",
"started_at": "2018-12-05T01:16:41.723Z",
"finished_at": "2018-12-05T02:35:54.046Z",
"committed_at": null,
"duration": 4436,
"coverage": "46.68",
"detailed_status": {
"icon": "status_warning",
"text": "passed",
"label": "passed with warnings",
"group": "success-with-warnings",
"tooltip": "passed",
"has_details": true,
"details_path": "/twitter/flight/pipelines/38",
"illustration": null,
"favicon": "https://gitlab.example.com/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png"
}
},
"diff_refs": {
"base_sha": "d052d768f0126e8cddf80afd8b1eb07f406a3fcb",
"head_sha": "81c6a84c7aebd45a1ac2c654aa87f11e32338e0a",
"start_sha": "d052d768f0126e8cddf80afd8b1eb07f406a3fcb"
},
"merge_error": null,
"user": {
"can_merge": true
}
2018-09-19 04:06:03 -04:00
}
]
```
2020-12-17 19:10:04 -05:00
## List merge requests that close a particular issue on merge
2017-04-12 07:38:00 -04:00
2020-12-17 19:10:04 -05:00
Get all merge requests that close a particular issue when merged.
2017-04-12 07:38:00 -04:00
2020-08-20 23:10:16 -04:00
If the project is private or the issue is confidential, you need to provide credentials to authorize.
2020-06-22 08:08:47 -04:00
The preferred way to do this, is by using [personal access tokens ](../user/profile/personal_access_tokens.md ).
2020-02-27 04:09:01 -05:00
```plaintext
2017-04-12 07:38:00 -04:00
GET /projects/:id/issues/:issue_iid/closed_by
```
2020-09-04 05:08:38 -04:00
| Attribute | Type | Required | Description |
| ----------- | ---------------| -------- | ---------------------------------- |
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2020-09-04 05:08:38 -04:00
| `issue_iid` | integer | yes | The internal ID of a project issue |
2017-04-12 07:38:00 -04:00
2020-01-30 10:09:15 -05:00
```shell
2020-05-27 20:08:37 -04:00
curl --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/projects/1/issues/11/closed_by"
2017-04-12 07:38:00 -04:00
```
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,
2018-02-27 12:21:37 -05:00
"closed_at": null,
"closed_by": null,
2017-04-12 07:38:00 -04:00
"labels": [],
2021-06-09 23:10:01 -04:00
"draft": false,
2017-04-12 07:38:00 -04:00
"work_in_progress": false,
"milestone": null,
"merge_when_pipeline_succeeds": false,
"merge_status": "unchecked",
"sha": "5a62481d563af92b8e32d735f2fa63b94e806835",
"merge_commit_sha": null,
2019-11-05 16:07:46 -05:00
"squash_commit_sha": null,
2017-04-12 07:38:00 -04:00
"user_notes_count": 1,
"should_remove_source_branch": null,
"force_remove_source_branch": false,
2017-08-19 13:49:39 -04:00
"web_url": "https://gitlab.example.com/gitlab-org/gitlab-test/merge_requests/6432",
2019-12-27 10:08:16 -05:00
"reference": "!6432",
"references": {
"short": "!6432",
"relative": "!6432",
"full": "gitlab-org/gitlab-test!6432"
},
2017-08-19 13:49:39 -04:00
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
}
2017-04-12 07:38:00 -04:00
}
2018-01-05 10:21:53 -05:00
]
```
## Participants on issues
2020-08-20 23:10:16 -04:00
If the project is private or the issue is confidential, you need to provide credentials to authorize.
2020-06-22 08:08:47 -04:00
The preferred way to do this, is by using [personal access tokens ](../user/profile/personal_access_tokens.md ).
2020-02-27 04:09:01 -05:00
```plaintext
2018-01-05 10:21:53 -05:00
GET /projects/:id/issues/:issue_iid/participants
```
| Attribute | Type | Required | Description |
|-------------|---------|----------|--------------------------------------|
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2018-01-05 10:21:53 -05:00
| `issue_iid` | integer | yes | The internal ID of a project's issue |
2020-01-30 10:09:15 -05:00
```shell
2020-05-27 20:08:37 -04:00
curl --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/projects/5/issues/93/participants"
2018-01-05 10:21:53 -05:00
```
Example response:
```json
[
{
"id": 1,
"name": "John Doe1",
"username": "user1",
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/c922747a93b40d1ea88262bf1aebee62?s=80& d=identicon",
2020-08-12 08:10:25 -04:00
"web_url": "http://gitlab.example.com/user1"
2018-01-05 10:21:53 -05:00
},
{
"id": 5,
"name": "John Doe5",
"username": "user5",
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/4aea8cf834ed91844a2da4ff7ae6b491?s=80& d=identicon",
2020-08-12 08:10:25 -04:00
"web_url": "http://gitlab.example.com/user5"
2018-01-05 10:21:53 -05:00
}
2017-04-12 07:38:00 -04:00
]
```
2014-04-30 11:28:05 -04:00
## Comments on issues
2016-01-18 03:10:46 -05:00
Comments are done via the [notes ](notes.md ) resource.
2017-07-05 10:50:53 -04:00
## Get user agent details
2020-12-17 19:10:04 -05:00
Available only for administrators.
2017-07-06 05:48:19 -04:00
2020-02-27 04:09:01 -05:00
```plaintext
2017-07-05 10:50:53 -04:00
GET /projects/:id/issues/:issue_iid/user_agent_detail
```
| Attribute | Type | Required | Description |
|-------------|---------|----------|--------------------------------------|
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2017-07-05 10:50:53 -04:00
| `issue_iid` | integer | yes | The internal ID of a project's issue |
2020-01-30 10:09:15 -05:00
```shell
2020-05-27 20:08:37 -04:00
curl --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/projects/5/issues/93/user_agent_detail"
2017-07-05 10:50:53 -04:00
```
Example response:
```json
{
"user_agent": "AppleWebKit/537.36",
"ip_address": "127.0.0.1",
2017-07-06 09:19:14 -04:00
"akismet_submitted": false
2017-07-05 10:50:53 -04:00
}
```
2020-07-21 20:09:26 -04:00
## List issue state events
To track which state was set, who did it, and when it happened, check out
2020-11-08 22:09:03 -05:00
[Resource state events API ](resource_state_events.md#issues ).
2020-11-20 07:09:35 -05:00
## Upload metric image
Available only for Incident issues.
```plaintext
POST /projects/:id/issues/:issue_iid/metric_images
```
| Attribute | Type | Required | Description |
|-------------|---------|----------|--------------------------------------|
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2020-11-20 07:09:35 -05:00
| `issue_iid` | integer | yes | The internal ID of a project's issue |
| `file` | file | yes | The image file to be uploaded |
2020-12-11 01:10:17 -05:00
| `url` | string | no | The URL to view more metric information |
2020-11-20 07:09:35 -05:00
```shell
curl --header "PRIVATE-TOKEN: < your_access_token > " --form 'file=@/path/to/file.png' \
--form 'url=http://example.com' "https://gitlab.example.com/api/v4/projects/5/issues/93/metric_images"
```
Example response:
```json
{
"id": 23,
"created_at": "2020-11-13T00:06:18.084Z",
"filename": "file.png",
"file_path": "/uploads/-/system/issuable_metric_image/file/23/file.png",
"url": "http://example.com"
}
```
## List metric images
Available only for Incident issues.
```plaintext
GET /projects/:id/issues/:issue_iid/metric_images
```
| Attribute | Type | Required | Description |
|-------------|---------|----------|--------------------------------------|
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2020-11-20 07:09:35 -05:00
| `issue_iid` | integer | yes | The internal ID of a project's issue |
```shell
curl --header "PRIVATE-TOKEN: < your_access_token > " "https://gitlab.example.com/api/v4/projects/5/issues/93/metric_images"
```
Example response:
```json
[
{
"id": 17,
"created_at": "2020-11-12T20:07:58.156Z",
"filename": "sample_2054",
"file_path": "/uploads/-/system/issuable_metric_image/file/17/sample_2054.png",
"url": "example.com/metric"
},
{
"id": 18,
"created_at": "2020-11-12T20:14:26.441Z",
"filename": "sample_2054",
"file_path": "/uploads/-/system/issuable_metric_image/file/18/sample_2054.png",
"url": "example.com/metric"
}
]
```
2021-01-14 16:10:37 -05:00
## Delete metric image
Available only for Incident issues.
```plaintext
DELETE /projects/:id/issues/:issue_iid/metric_images/:image_id
```
| Attribute | Type | Required | Description |
|-------------|---------|----------|--------------------------------------|
2021-06-28 11:08:03 -04:00
| `id` | integer/string | yes | The ID or [URL-encoded path of the project ](index.md#namespaced-path-encoding ) owned by the authenticated user |
2021-01-14 16:10:37 -05:00
| `issue_iid` | integer | yes | The internal ID of a project's issue |
| `image_id` | integer | yes | The ID of the image |
```shell
curl --header "PRIVATE-TOKEN: < your_access_token > " --request DELETE "https://gitlab.example.com/api/v4/projects/5/issues/93/metric_images/1"
```
Can return the following status codes:
- `204 No Content` , if the image was deleted successfully.
- `400 Bad Request` , if the image could not be deleted.