Issue Boards API

Issue Boards API

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

如果用户不是项目成员,并且该项目是私有项目,则对该项目的请求将导致404状态代码.

列出给定项目中的发行板.

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

响应示例:

  1. [ { "id" : 1, "project": { "id": 5, "name": "Diaspora Project Site", "name_with_namespace": "Diaspora / Diaspora Project Site", "path": "diaspora-project-site", "path_with_namespace": "diaspora/diaspora-project-site", "http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git", "web_url": "http://example.com/diaspora/diaspora-project-site" }, "milestone": { "id": 12, "title": "10.0" }, "lists" : [ { "id" : 1, "label" : { "name" : "Testing", "color" : "#F0AD4E", "description" : null }, "position" : 1, "max_issue_count": 0, "max_issue_weight": 0, "limit_metric": null }, { "id" : 2, "label" : { "name" : "Ready", "color" : "#FF0000", "description" : null }, "position" : 2, "max_issue_count": 0, "max_issue_weight": 0, "limit_metric": null }, { "id" : 3, "label" : { "name" : "Production", "color" : "#FF5F00", "description" : null }, "position" : 3, "max_issue_count": 0, "max_issue_weight": 0, "limit_metric": null } ] } ]

Single board

拿一块板.

  1. GET /projects/:id/boards/:board_id
Attribute Type Required Description
id integer/string yes 经过身份验证的用户拥有的 ID 或URL 编码路径
board_id integer yes 单板编号
  1. curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/boards/1"

响应示例:

  1. { "id": 1, "name": "project issue board", "project": { "id": 5, "name": "Diaspora Project Site", "name_with_namespace": "Diaspora / Diaspora Project Site", "path": "diaspora-project-site", "path_with_namespace": "diaspora/diaspora-project-site", "http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git", "web_url": "http://example.com/diaspora/diaspora-project-site" }, "milestone": { "id": 12, "title": "10.0" }, "lists" : [ { "id" : 1, "label" : { "name" : "Testing", "color" : "#F0AD4E", "description" : null }, "position" : 1, "max_issue_count": 0, "max_issue_weight": 0, "limit_metric": null }, { "id" : 2, "label" : { "name" : "Ready", "color" : "#FF0000", "description" : null }, "position" : 2, "max_issue_count": 0, "max_issue_weight": 0, "limit_metric": null }, { "id" : 3, "label" : { "name" : "Production", "color" : "#FF5F00", "description" : null }, "position" : 3, "max_issue_count": 0, "max_issue_weight": 0, "limit_metric": null } ] }

Create a board

  1. POST /projects/:id/boards
Attribute Type Required Description
id integer/string yes 经过身份验证的用户拥有的项目的 ID 或
name string yes 新板的名称
  1. curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/boards?name=newboard"

响应示例:

  1. { "id": 1, "project": { "id": 5, "name": "Diaspora Project Site", "name_with_namespace": "Diaspora / Diaspora Project Site", "path": "diaspora-project-site", "path_with_namespace": "diaspora/diaspora-project-site", "http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git", "web_url": "http://example.com/diaspora/diaspora-project-site" }, "name": "newboard", "milestone": { "id": 12 "title": "10.0" }, "lists" : [ { "id" : 1, "label" : { "name" : "Testing", "color" : "#F0AD4E", "description" : null }, "position" : 1, "max_issue_count": 0, "max_issue_weight": 0, "limit_metric": null }, { "id" : 2, "label" : { "name" : "Ready", "color" : "#FF0000", "description" : null }, "position" : 2, "max_issue_count": 0, "max_issue_weight": 0, "limit_metric": null }, { "id" : 3, "label" : { "name" : "Production", "color" : "#FF5F00", "description" : null }, "position" : 3, "max_issue_count": 0, "max_issue_weight": 0, "limit_metric": null } ] }

Introduced in 11.1.

更新板.

    响应示例:

    1. { "id": 1, "project": { "id": 5, "name": "Diaspora Project Site", "name_with_namespace": "Diaspora / Diaspora Project Site", "path": "diaspora-project-site", "path_with_namespace": "diaspora/diaspora-project-site", "created_at": "2018-07-03T05:48:49.982Z", "default_branch": null, "tag_list": [], "ssh_url_to_repo": "ssh://user@example.com/diaspora/diaspora-project-site.git", "http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git", "web_url": "http://example.com/diaspora/diaspora-project-site", "readme_url": null, "avatar_url": null, "star_count": 0, "forks_count": 0, "last_activity_at": "2018-07-03T05:48:49.982Z" }, "lists": [], "name": "new_name", "group": null, "milestone": { "id": 43, "iid": 1, "project_id": 15, "title": "Milestone 1", "description": "Milestone 1 desc", "state": "active", "created_at": "2018-07-03T06:36:42.618Z", "updated_at": "2018-07-03T06:36:42.618Z", "due_date": null, "start_date": null, "web_url": "http://example.com/root/board1/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": 10, "name": "Doing", "color": "#5CB85C", "description": null }], "weight": 4 }

    Delete a board

    删除板.

    1. DELETE /projects/:id/boards/:board_id
    Attribute Type Required Description
    id integer/string yes 经过身份验证的用户拥有的 ID 或URL 编码路径
    board_id integer yes 单板编号
    1. curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/boards/1"

    List board lists

    获取董事会名单的清单. 不包括openclosed列表

    1. GET /projects/:id/boards/:board_id/lists
    Attribute Type Required Description
    id integer/string yes 经过身份验证的用户拥有的项目的 ID 或
    board_id integer yes 单板编号
    1. curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/boards/1/lists"
    1. [ { "id" : 1, "label" : { "name" : "Testing", "color" : "#F0AD4E", "description" : null }, "position" : 1, "max_issue_count": 0, "max_issue_weight": 0, "limit_metric": null }, { "id" : 2, "label" : { "name" : "Ready", "color" : "#FF0000", "description" : null }, "position" : 2, "max_issue_count": 0, "max_issue_weight": 0, "limit_metric": null }, { "id" : 3, "label" : { "name" : "Production", "color" : "#FF5F00", "description" : null }, "position" : 3, "max_issue_count": 0, "max_issue_weight": 0, "limit_metric": null } ]

    获取单板列表.

    1. GET /projects/:id/boards/:board_id/lists/:list_id

    响应示例:

    1. { "id" : 1, "label" : { "name" : "Testing", "color" : "#F0AD4E", "description" : null }, "position" : 1, "max_issue_count": 0, "max_issue_weight": 0, "limit_metric": null }

    New board list

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

    1. POST /projects/:id/boards/:board_id/lists
    Attribute Type Required Description
    id integer/string yes 经过身份验证的用户拥有的 ID 或URL 编码路径
    board_id integer yes 单板编号
    label_id integer no 标签的 ID
    assignee_id integer no 用户的 ID
    milestone_id integer no 里程碑的 ID

    注意:标签,受让人和里程碑参数是互斥的,也就是说,请求中仅接受其中一个. 查看 ,以获取有关每种列表类型所需许可证的更多信息.

    1. curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/boards/1/lists?label_id=5"

    响应示例:

    1. { "id" : 1, "label" : { "name" : "Testing", "color" : "#F0AD4E", "description" : null }, "position" : 1, "max_issue_count": 0, "max_issue_weight": 0, "limit_metric": null }

    Edit board list

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

    1. PUT /projects/:id/boards/:board_id/lists/:list_id
    Attribute Type Required Description
    id integer/string yes 经过身份验证的用户拥有的 ID 或URL 编码路径
    board_id integer yes 单板编号
    list_id integer yes 单板编号
    position integer yes The position of the list
    1. curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/boards/1/lists/1?position=2"
    1. { "id" : 1, "label" : { "name" : "Testing", "color" : "#F0AD4E", "description" : null }, "position" : 1, "max_issue_count": 0, "max_issue_weight": 0, "limit_metric": null }

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