群组议题看板 API

  • Tier: 基础版, 专业版, 旗舰版
  • Offering: JihuLab.com, 私有化部署

每次 API 调用 群组议题看板 都必须经过身份验证。

如果用户不是群组成员并且群组是私有的,则 GET 请求会导致 404 状态码。

列出群组中的所有群组议题看板#

列出给定群组中的议题看板。

plaintext
GET /groups/:id/boards
属性类型必需描述
idinteger/string群组的 ID 或 URL 编码路径
shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/boards"

示例响应:

json
1[ 2 { 3 "id": 1, 4 "name": "group issue board", 5 "hide_backlog_list": false, 6 "hide_closed_list": false, 7 "group": { 8 "id": 5, 9 "name": "Documentcloud", 10 "web_url": "http://example.com/groups/documentcloud" 11 }, 12 "milestone": { 13 "id": 12, 14 "title": "10.0" 15 }, 16 "lists" : [ 17 { 18 "id" : 1, 19 "label" : { 20 "name" : "Testing", 21 "color" : "#F0AD4E", 22 "description" : null 23 }, 24 "position" : 1 25 }, 26 { 27 "id" : 2, 28 "label" : { 29 "name" : "Ready", 30 "color" : "#FF0000", 31 "description" : null 32 }, 33 "position" : 2 34 }, 35 { 36 "id" : 3, 37 "label" : { 38 "name" : "Production", 39 "color" : "#FF5F00", 40 "description" : null 41 }, 42 "position" : 3 43 } 44 ] 45 } 46]

极狐GitLab专业版或旗舰版 的用户会看到不同的参数,因为可以有多个群组看板。

示例响应:

json
1[ 2 { 3 "id": 1, 4 "name": "group issue board", 5 "hide_backlog_list": false, 6 "hide_closed_list": false, 7 "group": { 8 "id": 5, 9 "name": "Documentcloud", 10 "web_url": "http://example.com/groups/documentcloud" 11 }, 12 "milestone": { 13 "id": 12, 14 "title": "10.0" 15 }, 16 "lists" : [ 17 { 18 "id" : 1, 19 "label" : { 20 "name" : "Testing", 21 "color" : "#F0AD4E", 22 "description" : null 23 }, 24 "position" : 1 25 }, 26 { 27 "id" : 2, 28 "label" : { 29 "name" : "Ready", 30 "color" : "#FF0000", 31 "description" : null 32 }, 33 "position" : 2 34 }, 35 { 36 "id" : 3, 37 "label" : { 38 "name" : "Production", 39 "color" : "#FF5F00", 40 "description" : null 41 }, 42 "position" : 3 43 } 44 ] 45 } 46]

单个群组议题看板#

获取单个群组议题看板。

plaintext
GET /groups/:id/boards/:board_id
属性类型必需描述
idinteger/string群组的 ID 或 URL 编码路径
board_idinteger看板的 ID。
shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/boards/1"

示例响应:

json
1 { 2 "id": 1, 3 "name": "group issue board", 4 "hide_backlog_list": false, 5 "hide_closed_list": false, 6 "group": { 7 "id": 5, 8 "name": "Documentcloud", 9 "web_url": "http://example.com/groups/documentcloud" 10 }, 11 "milestone": { 12 "id": 12, 13 "title": "10.0" 14 }, 15 "lists" : [ 16 { 17 "id" : 1, 18 "label" : { 19 "name" : "Testing", 20 "color" : "#F0AD4E", 21 "description" : null 22 }, 23 "position" : 1 24 }, 25 { 26 "id" : 2, 27 "label" : { 28 "name" : "Ready", 29 "color" : "#FF0000", 30 "description" : null 31 }, 32 "position" : 2 33 }, 34 { 35 "id" : 3, 36 "label" : { 37 "name" : "Production", 38 "color" : "#FF5F00", 39 "description" : null 40 }, 41 "position" : 3 42 } 43 ] 44 }

极狐GitLab专业版或旗舰版 的用户会看到不同的参数,因为可以有多个群组议题看板。

示例响应:

json
1 { 2 "id": 1, 3 "name": "group issue board", 4 "hide_backlog_list": false, 5 "hide_closed_list": false, 6 "group": { 7 "id": 5, 8 "name": "Documentcloud", 9 "web_url": "http://example.com/groups/documentcloud" 10 }, 11 "milestone": { 12 "id": 12, 13 "title": "10.0" 14 }, 15 "lists" : [ 16 { 17 "id" : 1, 18 "label" : { 19 "name" : "Testing", 20 "color" : "#F0AD4E", 21 "description" : null 22 }, 23 "position" : 1 24 }, 25 { 26 "id" : 2, 27 "label" : { 28 "name" : "Ready", 29 "color" : "#FF0000", 30 "description" : null 31 }, 32 "position" : 2 33 }, 34 { 35 "id" : 3, 36 "label" : { 37 "name" : "Production", 38 "color" : "#FF5F00", 39 "description" : null 40 }, 41 "position" : 3 42 } 43 ] 44 }

创建群组议题看板#

  • Tier: 专业版, 旗舰版
  • Offering: JihuLab.com, 私有化部署

创建群组议题看板。

plaintext
POST /groups/:id/boards
属性类型必需描述
idinteger/string群组的 ID 或 URL 编码路径
namestring新看板的名称。
shell
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/boards?name=newboard"

示例响应:

json
1 { 2 "id": 1, 3 "name": "newboard", 4 "hide_backlog_list": false, 5 "hide_closed_list": false, 6 "project": null, 7 "lists" : [], 8 "group": { 9 "id": 5, 10 "name": "Documentcloud", 11 "web_url": "http://example.com/groups/documentcloud" 12 }, 13 "milestone": null, 14 "assignee" : null, 15 "labels" : [], 16 "weight" : null 17 }

更新群组议题看板#

更新群组议题看板。

plaintext
PUT /groups/:id/boards/:board_id
属性类型必需描述
idinteger/string群组的 ID 或 URL 编码路径
board_idinteger看板的 ID。
namestring看板的新名称。
hide_backlog_listboolean隐藏未处理列表。
hide_closed_listboolean隐藏已关闭列表。
assignee_idinteger看板应限定的负责人。仅适用于专业版和旗舰版。
milestone_idinteger看板应限定的里程碑。仅适用于专业版和旗舰版。
labelsstring用逗号分隔的标签名称列表,限定看板。仅适用于专业版和旗舰版。
weightinteger权重范围从 0 到 9,看板应限定。仅适用于专业版和旗舰版。
shell
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"

示例响应:

json
1 { 2 "id": 1, 3 "name": "new_name", 4 "hide_backlog_list": false, 5 "hide_closed_list": false, 6 "project": null, 7 "lists": [], 8 "group": { 9 "id": 5, 10 "name": "Documentcloud", 11 "web_url": "http://example.com/groups/documentcloud" 12 }, 13 "milestone": { 14 "id": 44, 15 "iid": 1, 16 "group_id": 5, 17 "title": "Group Milestone", 18 "description": "Group Milestone Desc", 19 "state": "active", 20 "created_at": "2018-07-03T07:15:19.271Z", 21 "updated_at": "2018-07-03T07:15:19.271Z", 22 "due_date": null, 23 "start_date": null, 24 "web_url": "http://example.com/groups/documentcloud/-/milestones/1" 25 }, 26 "assignee": { 27 "id": 1, 28 "name": "**管理员**", 29 "username": "root", 30 "state": "active", 31 "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", 32 "web_url": "http://example.com/root" 33 }, 34 "labels": [{ 35 "id": 11, 36 "name": "GroupLabel", 37 "color": "#428BCA", 38 "description": "" 39 }], 40 "weight": 4 41 }

删除群组议题看板#

  • Tier: 专业版, 旗舰版
  • Offering: JihuLab.com, 私有化部署

删除群组议题看板。

plaintext
DELETE /groups/:id/boards/:board_id
属性类型必需描述
idinteger/string群组的 ID 或 URL 编码路径
board_idinteger看板的 ID。
shell
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/boards/1"

列出群组议题看板列表#

获取看板列表。不包括 openclosed 列表

plaintext
GET /groups/:id/boards/:board_id/lists
属性类型必需描述
idinteger/string群组的 ID 或 URL 编码路径
board_idinteger看板的 ID。
shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/boards/1/lists"

示例响应:

json
1[ 2 { 3 "id" : 1, 4 "label" : { 5 "name" : "Testing", 6 "color" : "#F0AD4E", 7 "description" : null 8 }, 9 "position" : 1 10 }, 11 { 12 "id" : 2, 13 "label" : { 14 "name" : "Ready", 15 "color" : "#FF0000", 16 "description" : null 17 }, 18 "position" : 2 19 }, 20 { 21 "id" : 3, 22 "label" : { 23 "name" : "Production", 24 "color" : "#FF5F00", 25 "description" : null 26 }, 27 "position" : 3 28 } 29]

单个群组议题看板列表#

获取单个看板列表。

plaintext
GET /groups/:id/boards/:board_id/lists/:list_id
属性类型必需描述
idinteger/string群组的 ID 或 URL 编码路径
board_idinteger看板的 ID。
list_idinteger看板列表的 ID。
shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/boards/1/lists/1"

示例响应:

json
1{ 2 "id" : 1, 3 "label" : { 4 "name" : "Testing", 5 "color" : "#F0AD4E", 6 "description" : null 7 }, 8 "position" : 1 9}

新建群组议题看板列表#

创建议题看板列表。

plaintext
POST /groups/:id/boards/:board_id/lists
属性类型必需描述
idinteger/string群组的 ID 或 URL 编码路径
board_idinteger看板的 ID。
label_idinteger标签的 ID。
assignee_idinteger用户的 ID。仅适用于专业版和旗舰版。
milestone_idinteger里程碑的 ID。仅适用于专业版和旗舰版。
iteration_idinteger迭代的 ID。仅适用于专业版和旗舰版。
shell
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/boards/12/lists?milestone_id=7"

示例响应:

json
1{ 2 "id": 9, 3 "label": null, 4 "position": 0, 5 "milestone": { 6 "id": 7, 7 "iid": 3, 8 "group_id": 12, 9 "title": "Milestone with due date", 10 "description": "", 11 "state": "active", 12 "created_at": "2017-09-03T07:16:28.596Z", 13 "updated_at": "2017-09-03T07:16:49.521Z", 14 "due_date": null, 15 "start_date": null, 16 "web_url": "https://gitlab.example.com/groups/issue-reproduce/-/milestones/3" 17 } 18}

编辑群组议题看板列表#

更新现有的议题看板列表。此调用用于更改列表位置。

plaintext
PUT /groups/:id/boards/:board_id/lists/:list_id
属性类型必需描述
idinteger/string群组的 ID 或 URL 编码路径
board_idinteger看板的 ID。
list_idinteger看板列表的 ID。
positioninteger列表的位置。
shell
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/group/5/boards/1/lists/1?position=2"

示例响应:

json
1{ 2 "id" : 1, 3 "label" : { 4 "name" : "Testing", 5 "color" : "#F0AD4E", 6 "description" : null 7 }, 8 "position" : 1 9}

删除群组议题看板列表#

仅限管理员和群组所有者。删除相关的看板列表。

plaintext
DELETE /groups/:id/boards/:board_id/lists/:list_id
属性类型必需描述
idinteger/string群组的 ID 或 URL 编码路径
board_idinteger看板的 ID。
list_idinteger看板列表的 ID。
shell
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/boards/1/lists/1"