321.md 12.9 KB
Newer Older
Lab机器人's avatar
readme  
Lab机器人 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265
# Group Issue Boards API

> 原文:[https://docs.gitlab.com/ee/api/group_boards.html](https://docs.gitlab.com/ee/api/group_boards.html)

*   [List all group issue boards in a group](#list-all-group-issue-boards-in-a-group)
*   [Single group issue board](#single-group-issue-board)
*   [Create a group issue board](#create-a-group-issue-board-premium)
*   [Update a group issue board](#update-a-group-issue-board-premium)
*   [Delete a group issue board](#delete-a-group-issue-board-premium)
*   [List group issue board lists](#list-group-issue-board-lists)
*   [Single group issue board list](#single-group-issue-board-list)
*   [New group issue board list](#new-group-issue-board-list)
*   [Edit group issue board list](#edit-group-issue-board-list)
*   [Delete a group issue board list](#delete-a-group-issue-board-list)

# Group Issue Boards API[](#group-issue-boards-api "Permalink")

对组板的每个 API 调用都必须经过身份验证.

If a user is not a member of a group and the group is private, a `GET` request will result in `404` status code.

## List all group issue boards in a group[](#list-all-group-issue-boards-in-a-group "Permalink")

列出给定组中的发行板.

```
GET /groups/:id/boards 
```

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 认证用户拥有[的组](README.html#namespaced-path-encoding)的 ID 或[URL 编码路径](README.html#namespaced-path-encoding) |

```
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/boards" 
```

响应示例:

```
[  {  "id":  1,  "name:":  "group issue board",  "group":  {  "id":  5,  "name":  "Documentcloud",  "web_url":  "http://example.com/groups/documentcloud"  },  "milestone":  {  "id":  12  "title":  "10.0"  },  "lists"  :  [  {  "id"  :  1,  "label"  :  {  "name"  :  "Testing",  "color"  :  "#F0AD4E",  "description"  :  null  },  "position"  :  1  },  {  "id"  :  2,  "label"  :  {  "name"  :  "Ready",  "color"  :  "#FF0000",  "description"  :  null  },  "position"  :  2  },  {  "id"  :  3,  "label"  :  {  "name"  :  "Production",  "color"  :  "#FF5F00",  "description"  :  null  },  "position"  :  3  }  ]  }  ] 
```

由于具有多个组板的能力,使用 GitLab [Premium,Silver 或更高版本的用户](https://about.gitlab.com/pricing/)将看到不同的参数.

响应示例:

```
[  {  "id":  1,  "name:":  "group issue board",  "group":  {  "id":  5,  "name":  "Documentcloud",  "web_url":  "http://example.com/groups/documentcloud"  },  "milestone":  {  "id":  12  "title":  "10.0"  },  "lists"  :  [  {  "id"  :  1,  "label"  :  {  "name"  :  "Testing",  "color"  :  "#F0AD4E",  "description"  :  null  },  "position"  :  1  },  {  "id"  :  2,  "label"  :  {  "name"  :  "Ready",  "color"  :  "#FF0000",  "description"  :  null  },  "position"  :  2  },  {  "id"  :  3,  "label"  :  {  "name"  :  "Production",  "color"  :  "#FF5F00",  "description"  :  null  },  "position"  :  3  }  ]  }  ] 
```

## Single group issue board[](#single-group-issue-board "Permalink")

获取单个小组问题委员会.

```
GET /groups/:id/boards/:board_id 
```

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 认证用户拥有[的组](README.html#namespaced-path-encoding)的 ID 或[URL 编码路径](README.html#namespaced-path-encoding) |
| `board_id` | integer | yes | 单板编号 |

```
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/boards/1" 
```

响应示例:

```
 {  "id":  1,  "name:":  "group issue board",  "group":  {  "id":  5,  "name":  "Documentcloud",  "web_url":  "http://example.com/groups/documentcloud"  },  "milestone":  {  "id":  12  "title":  "10.0"  },  "lists"  :  [  {  "id"  :  1,  "label"  :  {  "name"  :  "Testing",  "color"  :  "#F0AD4E",  "description"  :  null  },  "position"  :  1  },  {  "id"  :  2,  "label"  :  {  "name"  :  "Ready",  "color"  :  "#FF0000",  "description"  :  null  },  "position"  :  2  },  {  "id"  :  3,  "label"  :  {  "name"  :  "Production",  "color"  :  "#FF5F00",  "description"  :  null  },  "position"  :  3  }  ]  } 
```

GitLab [Premium,Silver 或更高版本的用户](https://about.gitlab.com/pricing/)将看到不同的参数,这是因为它具有多个组发行板的功能.

响应示例:

```
 {  "id":  1,  "name:":  "group issue board",  "group":  {  "id":  5,  "name":  "Documentcloud",  "web_url":  "http://example.com/groups/documentcloud"  },  "milestone":  {  "id":  12  "title":  "10.0"  },  "lists"  :  [  {  "id"  :  1,  "label"  :  {  "name"  :  "Testing",  "color"  :  "#F0AD4E",  "description"  :  null  },  "position"  :  1  },  {  "id"  :  2,  "label"  :  {  "name"  :  "Ready",  "color"  :  "#FF0000",  "description"  :  null  },  "position"  :  2  },  {  "id"  :  3,  "label"  :  {  "name"  :  "Production",  "color"  :  "#FF5F00",  "description"  :  null  },  "position"  :  3  }  ]  } 
```

## Create a group issue board[](#create-a-group-issue-board-premium "Permalink")

创建一个小组发行委员会.

```
POST /groups/:id/boards 
```

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 认证用户拥有[的组](README.html#namespaced-path-encoding)的 ID 或[URL 编码路径](README.html#namespaced-path-encoding) |
| `name` | string | yes | 新板的名称 |

```
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/boards?name=newboard" 
```

响应示例:

```
 {  "id":  1,  "name":  "newboard",  "group":  {  "id":  5,  "name":  "Documentcloud",  "web_url":  "http://example.com/groups/documentcloud"  },  "milestone":  {  "id":  12  "title":  "10.0"  },  "lists"  :  [  {  "id"  :  1,  "label"  :  {  "name"  :  "Testing",  "color"  :  "#F0AD4E",  "description"  :  null  },  "position"  :  1  },  {  "id"  :  2,  "label"  :  {  "name"  :  "Ready",  "color"  :  "#FF0000",  "description"  :  null  },  "position"  :  2  },  {  "id"  :  3,  "label"  :  {  "name"  :  "Production",  "color"  :  "#FF5F00",  "description"  :  null  },  "position"  :  3  }  ]  } 
```

## Update a group issue board[](#update-a-group-issue-board-premium "Permalink")

在 GitLab 11.1 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/5954) .

更新组发行板.

```
PUT /groups/:id/boards/:board_id 
```

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 认证用户拥有[的组](README.html#namespaced-path-encoding)的 ID 或[URL 编码路径](README.html#namespaced-path-encoding) |
| `board_id` | integer | yes | 单板编号 |
| `name` | string | no | 董事会的新名称 |
| `assignee_id` | integer | no | 董事会受让人的范围应为 |
| `milestone_id` | integer | no | 董事会应达到的里程碑 |
| `labels` | string | no | 以逗号分隔的标签名称列表,该范围应适用于板 |
| `weight` | integer | no | 重量范围从 0 到 9,该板的范围应为 |

```
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/boards/1?name=new_name&milestone_id=44&assignee_id=1&labels=GroupLabel&weight=4" 
```

响应示例:

```
 {  "id":  1,  "project":  null,  "lists":  [],  "name":  "new_name",  "group":  {  "id":  5,  "name":  "Documentcloud",  "web_url":  "http://example.com/groups/documentcloud"  },  "milestone":  {  "id":  44,  "iid":  1,  "group_id":  5,  "title":  "Group Milestone",  "description":  "Group Milestone Desc",  "state":  "active",  "created_at":  "2018-07-03T07:15:19.271Z",  "updated_at":  "2018-07-03T07:15:19.271Z",  "due_date":  null,  "start_date":  null,  "web_url":  "http://example.com/groups/documentcloud/-/milestones/1"  },  "assignee":  {  "id":  1,  "name":  "Administrator",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",  "web_url":  "http://example.com/root"  },  "labels":  [{  "id":  11,  "name":  "GroupLabel",  "color":  "#428BCA",  "description":  ""  }],  "weight":  4  } 
```

## Delete a group issue board[](#delete-a-group-issue-board-premium "Permalink")

删除组发行板.

```
DELETE /groups/:id/boards/:board_id 
```

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 认证用户拥有[的组](README.html#namespaced-path-encoding)的 ID 或[URL 编码路径](README.html#namespaced-path-encoding) |
| `board_id` | integer | yes | 单板编号 |

```
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/boards/1" 
```

## List group issue board lists[](#list-group-issue-board-lists "Permalink")

获取董事会名单的清单. 不包括`open``closed`列表

```
GET /groups/:id/boards/:board_id/lists 
```

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 认证用户拥有[的组](README.html#namespaced-path-encoding)的 ID 或[URL 编码路径](README.html#namespaced-path-encoding) |
| `board_id` | integer | yes | 单板编号 |

```
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/boards/1/lists" 
```

响应示例:

```
[  {  "id"  :  1,  "label"  :  {  "name"  :  "Testing",  "color"  :  "#F0AD4E",  "description"  :  null  },  "position"  :  1  },  {  "id"  :  2,  "label"  :  {  "name"  :  "Ready",  "color"  :  "#FF0000",  "description"  :  null  },  "position"  :  2  },  {  "id"  :  3,  "label"  :  {  "name"  :  "Production",  "color"  :  "#FF5F00",  "description"  :  null  },  "position"  :  3  }  ] 
```

## Single group issue board list[](#single-group-issue-board-list "Permalink")

获取单板列表.

```
GET /groups/:id/boards/:board_id/lists/:list_id 
```

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 认证用户拥有[的组](README.html#namespaced-path-encoding)的 ID 或[URL 编码路径](README.html#namespaced-path-encoding) |
| `board_id` | integer | yes | 单板编号 |
| `list_id` | integer | yes | 单板编号 |

```
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/boards/1/lists/1" 
```

响应示例:

```
{  "id"  :  1,  "label"  :  {  "name"  :  "Testing",  "color"  :  "#F0AD4E",  "description"  :  null  },  "position"  :  1  } 
```

## New group issue board list[](#new-group-issue-board-list "Permalink")

创建一个新的发行委员会列表.

```
POST /groups/:id/boards/:board_id/lists 
```

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 认证用户拥有[的组](README.html#namespaced-path-encoding)的 ID 或[URL 编码路径](README.html#namespaced-path-encoding) |
| `board_id` | integer | yes | 单板编号 |
| `label_id` | integer | yes | 标签的 ID |

```
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/4/boards/12/lists?milestone_id=7" 
```

响应示例:

```
{  "id":  9,  "label":  null,  "position":  0,  "milestone":  {  "id":  7,  "iid":  3,  "group_id":  12,  "title":  "Milestone with due date",  "description":  "",  "state":  "active",  "created_at":  "2017-09-03T07:16:28.596Z",  "updated_at":  "2017-09-03T07:16:49.521Z",  "due_date":  null,  "start_date":  null,  "web_url":  "https://gitlab.example.com/groups/issue-reproduce/-/milestones/3"  }  } 
```

## Edit group issue board list[](#edit-group-issue-board-list "Permalink")

更新现有的发行委员会列表. 此调用用于更改列表位置.

```
PUT /groups/:id/boards/:board_id/lists/:list_id 
```

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 认证用户拥有[的组](README.html#namespaced-path-encoding)的 ID 或[URL 编码路径](README.html#namespaced-path-encoding) |
| `board_id` | integer | yes | 单板编号 |
| `list_id` | integer | yes | 单板编号 |
| `position` | integer | yes | 清单的位置 |

```
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/group/5/boards/1/lists/1?position=2" 
```

响应示例:

```
{  "id"  :  1,  "label"  :  {  "name"  :  "Testing",  "color"  :  "#F0AD4E",  "description"  :  null  },  "position"  :  1  } 
```

## Delete a group issue board list[](#delete-a-group-issue-board-list "Permalink")

仅适用于管理员和群组所有者. 删除相关的单板列表.

```
DELETE /groups/:id/boards/:board_id/lists/:list_id 
```

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 认证用户拥有[的组](README.html#namespaced-path-encoding)的 ID 或[URL 编码路径](README.html#namespaced-path-encoding) |
| `board_id` | integer | yes | 单板编号 |
| `list_id` | integer | yes | 单板编号 |

```
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/boards/1/lists/1" 
```