# 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" 
```