issues.md 4.24 KB
Newer Older
Nihad Abbasov's avatar
Nihad Abbasov committed
1 2
## List issues

Johannes Schleifenbaum's avatar
Johannes Schleifenbaum committed
3
Get all issues created by authenticated user. This function takes pagination parameters
4
`page` and `per_page` to restrict the list of issues.
Nihad Abbasov's avatar
Nihad Abbasov committed
5 6 7 8 9 10 11 12 13

```
GET /issues
```

```json
[
  {
    "id": 43,
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
14
    "iid": 3,
15
    "project_id": 8,
Nihad Abbasov's avatar
Nihad Abbasov committed
16 17 18 19 20 21 22
    "title": "4xx/5xx pages",
    "description": "",
    "labels": [ ],
    "milestone": null,
    "assignee": null,
    "author": {
      "id": 1,
23
      "username": "john_smith",
Nihad Abbasov's avatar
Nihad Abbasov committed
24 25
      "email": "john@example.com",
      "name": "John Smith",
26
      "state": "active",
Nihad Abbasov's avatar
Nihad Abbasov committed
27 28
      "created_at": "2012-05-23T08:00:58Z"
    },
29
    "state": "closed",
Nihad Abbasov's avatar
Nihad Abbasov committed
30 31 32 33 34
    "updated_at": "2012-07-02T17:53:12Z",
    "created_at": "2012-07-02T17:53:12Z"
  },
  {
    "id": 42,
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
35
    "iid": 4,
36
    "project_id": 8,
Nihad Abbasov's avatar
Nihad Abbasov committed
37 38 39 40 41 42 43 44 45 46
    "title": "Add user settings",
    "description": "",
    "labels": [
      "feature"
    ],
    "milestone": {
      "id": 1,
      "title": "v1.0",
      "description": "",
      "due_date": "2012-07-20",
47
      "state": "reopenend",
Nihad Abbasov's avatar
Nihad Abbasov committed
48 49 50 51 52
      "updated_at": "2012-07-04T13:42:48Z",
      "created_at": "2012-07-04T13:42:48Z"
    },
    "assignee": {
      "id": 2,
53
      "username": "jack_smith",
Nihad Abbasov's avatar
Nihad Abbasov committed
54 55
      "email": "jack@example.com",
      "name": "Jack Smith",
56
      "state": "active",
Nihad Abbasov's avatar
Nihad Abbasov committed
57 58 59 60
      "created_at": "2012-05-23T08:01:01Z"
    },
    "author": {
      "id": 1,
61
      "username": "john_smith",
Nihad Abbasov's avatar
Nihad Abbasov committed
62 63
      "email": "john@example.com",
      "name": "John Smith",
64
      "state": "active",
Nihad Abbasov's avatar
Nihad Abbasov committed
65 66
      "created_at": "2012-05-23T08:00:58Z"
    },
67
    "state": "opened",
Nihad Abbasov's avatar
Nihad Abbasov committed
68 69 70 71 72 73
    "updated_at": "2012-07-12T13:43:19Z",
    "created_at": "2012-06-28T12:58:06Z"
  }
]
```

74

Nihad Abbasov's avatar
Nihad Abbasov committed
75 76
## List project issues

77 78
Get a list of project issues. This function accepts pagination parameters `page` and `per_page`
to return the list of project issues.
Nihad Abbasov's avatar
Nihad Abbasov committed
79 80 81 82 83 84 85

```
GET /projects/:id/issues
```

Parameters:

86
+ `id` (required) - The ID of a project
Nihad Abbasov's avatar
Nihad Abbasov committed
87

88

Nihad Abbasov's avatar
Nihad Abbasov committed
89 90
## Single issue

91
Gets a single project issue.
Nihad Abbasov's avatar
Nihad Abbasov committed
92 93 94 95 96 97 98

```
GET /projects/:id/issues/:issue_id
```

Parameters:

99
+ `id` (required) - The ID of a project
Nihad Abbasov's avatar
Nihad Abbasov committed
100 101 102 103 104
+ `issue_id` (required) - The ID of a project issue

```json
{
  "id": 42,
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
105
  "iid": 3,
106
  "project_id": 8,
Nihad Abbasov's avatar
Nihad Abbasov committed
107 108 109 110 111 112 113 114 115 116
  "title": "Add user settings",
  "description": "",
  "labels": [
    "feature"
  ],
  "milestone": {
    "id": 1,
    "title": "v1.0",
    "description": "",
    "due_date": "2012-07-20",
117
    "state": "closed",
Nihad Abbasov's avatar
Nihad Abbasov committed
118 119 120 121 122
    "updated_at": "2012-07-04T13:42:48Z",
    "created_at": "2012-07-04T13:42:48Z"
  },
  "assignee": {
    "id": 2,
123
    "username": "jack_smith",
Nihad Abbasov's avatar
Nihad Abbasov committed
124 125
    "email": "jack@example.com",
    "name": "Jack Smith",
126
    "state": "active",
Nihad Abbasov's avatar
Nihad Abbasov committed
127 128 129 130
    "created_at": "2012-05-23T08:01:01Z"
  },
  "author": {
    "id": 1,
131
    "username": "john_smith",
Nihad Abbasov's avatar
Nihad Abbasov committed
132 133
    "email": "john@example.com",
    "name": "John Smith",
134
    "state": "active",
Nihad Abbasov's avatar
Nihad Abbasov committed
135 136
    "created_at": "2012-05-23T08:00:58Z"
  },
137
  "state": "opened",
Nihad Abbasov's avatar
Nihad Abbasov committed
138 139 140 141 142
  "updated_at": "2012-07-12T13:43:19Z",
  "created_at": "2012-06-28T12:58:06Z"
}
```

143

Nihad Abbasov's avatar
Nihad Abbasov committed
144 145
## New issue

146
Creates a new project issue.
Nihad Abbasov's avatar
Nihad Abbasov committed
147 148 149 150 151 152 153

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

Parameters:

154
+ `id` (required) - The ID of a project
Nihad Abbasov's avatar
Nihad Abbasov committed
155 156 157 158 159 160 161 162 163
+ `title` (required) - The title of an issue
+ `description` (optional) - The description of an issue
+ `assignee_id` (optional) - The ID of a user to assign issue
+ `milestone_id` (optional) - The ID of a milestone to assign issue
+ `labels` (optional) - Comma-separated label names for an issue


## Edit issue

164
Updates an existing project issue. This function is also used to mark an issue as closed.
Nihad Abbasov's avatar
Nihad Abbasov committed
165 166 167 168 169 170 171

```
PUT /projects/:id/issues/:issue_id
```

Parameters:

172
+ `id` (required) - The ID of a project
Nihad Abbasov's avatar
Nihad Abbasov committed
173 174 175 176 177 178
+ `issue_id` (required) - The ID of a project's issue
+ `title` (optional) - The title of an issue
+ `description` (optional) - The description of an issue
+ `assignee_id` (optional) - The ID of a user to assign issue
+ `milestone_id` (optional) - The ID of a milestone to assign issue
+ `labels` (optional) - Comma-separated label names for an issue
179
+ `state_event` (optional) - The state event of an issue ('close' to close issue and 'reopen' to reopen it)
Nihad Abbasov's avatar
Nihad Abbasov committed
180

181 182 183 184 185 186 187 188 189 190 191 192 193 194 195

## Delete existing issue (**Deprecated**)

The function is deprecated and returns a `405 Method Not Allowed`
error if called. An issue gets now closed and is done by calling `PUT /projects/:id/issues/:issue_id` with
parameter `closed` set to 1.

```
DELETE /projects/:id/issues/:issue_id
```

Parameters:

+ `id` (required) - The project ID
+ `issue_id` (required) - The ID of the issue