Help us learn about your current experience with the documentation. Take the survey.

群组 issue boards API

  • Tier: Free, Premium, Ultimate
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated

group issue boards的每个 API 调用都必须经过身份验证。

如果用户不是群组成员且该群组是私有的,GET 请求将返回 404 状态码。

列出群组中的所有群组 issue boards

列出指定群组中的 issue boards。

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

示例响应:

[
  {
    "id": 1,
    "name": "group issue board",
    "hide_backlog_list": false,
    "hide_closed_list": false,
    "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 或 Ultimate 用户会看到不同的参数,因为可以拥有多个群组 boards。

示例响应:

[
  {
    "id": 1,
    "name": "group issue board",
    "hide_backlog_list": false,
    "hide_closed_list": false,
    "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
      }
    ]
  }
]

单个群组 issue board

获取单个群组 issue board。

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

示例响应:

  {
    "id": 1,
    "name": "group issue board",
    "hide_backlog_list": false,
    "hide_closed_list": false,
    "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 或 Ultimate 用户会看到不同的参数,因为可以拥有多个群组 issue boards。

示例响应:

  {
    "id": 1,
    "name": "group issue board",
    "hide_backlog_list": false,
    "hide_closed_list": false,
    "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
      }
    ]
  }

创建群组 issue board

  • Tier: Premium, Ultimate
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated

创建群组 issue board。

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

示例响应:

  {
    "id": 1,
    "name": "newboard",
    "hide_backlog_list": false,
    "hide_closed_list": false,
    "project": null,
    "lists" : [],
    "group": {
      "id": 5,
      "name": "Documentcloud",
      "web_url": "http://example.com/groups/documentcloud"
    },
    "milestone": null,
    "assignee" : null,
    "labels" : [],
    "weight" : null
  }

更新群组 issue board

更新群组 issue board。

PUT /groups/:id/boards/:board_id
属性 类型 必需 描述
id integer/string yes 群组的 ID 或 URL 编码路径
board_id integer yes board 的 ID。
name string no board 的新名称。
hide_backlog_list boolean no 隐藏 Open 列表。
hide_closed_list boolean no 隐藏 Closed 列表。
assignee_id integer no board 应限定到的指派人。仅限 Premium 和 Ultimate。
milestone_id integer no board 应限定到的里程碑。仅限 Premium 和 Ultimate。
labels string no board 应限定到的标签名称的逗号分隔列表。仅限 Premium 和 Ultimate。
weight integer no board 应限定到的权重范围(0 到 9)。仅限 Premium 和 Ultimate。
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,
    "name": "new_name",
    "hide_backlog_list": false,
    "hide_closed_list": false,
    "project": null,
    "lists": [],
    "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
  }

删除群组 issue board

  • Tier: Premium, Ultimate
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated

删除群组 issue board。

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

列出群组 issue board 列表

获取 board 列表的列表。 不包括 openclosed 列表

GET /groups/:id/boards/:board_id/lists
属性 类型 必需 描述
id integer/string yes 群组的 ID 或 URL 编码路径
board_id integer yes board 的 ID。
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
  }
]

单个群组 issue board 列表

获取单个 board 列表。

GET /groups/:id/boards/:board_id/lists/:list_id
属性 类型 必需 描述
id integer/string yes 群组的 ID 或 URL 编码路径
board_id integer yes board 的 ID。
list_id integer yes board 列表的 ID。
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
}

新建群组 issue board 列表

创建 issue board 列表。

POST /groups/:id/boards/:board_id/lists
属性 类型 必需 描述
id integer/string yes 群组的 ID 或 URL 编码路径
board_id integer yes board 的 ID。
label_id integer no 标签的 ID。
assignee_id integer no 用户的 ID。仅限 Premium 和 Ultimate。
milestone_id integer no 里程碑的 ID。仅限 Premium 和 Ultimate。
iteration_id integer no 迭代的 ID。仅限 Premium 和 Ultimate。
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/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"
  }
}

编辑群组 issue board 列表

更新现有的 issue board 列表。此调用用于更改列表位置。

PUT /groups/:id/boards/:board_id/lists/:list_id
属性 类型 必需 描述
id integer/string yes 群组的 ID 或 URL 编码路径
board_id integer yes board 的 ID。
list_id integer yes board 列表的 ID。
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
}

删除群组 issue board 列表

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

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