Epic Links API

原文:https://docs.gitlab.com/ee/api/epic_links.html

Epic Links API

注意:该端点是在 GitLab 11.8 中引入的 .

管理亲子史诗般的关系 .

每个对epic_links API 调用epic_links必须经过身份验证.

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

多级史诗仅在 GitLab Ultimate / Gold中可用. 如果”多级史诗”功能不可用,将返回403状态代码.

List epics related to a given epic

获取史诗的所有子史诗.

  1. GET /groups/:id/epics/:epic_iid/epics
Attribute Type Required Description
id integer/string yes 认证用户拥有的组的 ID 或URL 编码路径
epic_iid integer yes 史诗的内部 ID.
  1. curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/epics/5/epics/"

响应示例:

  1. [ { "id": 29, "iid": 6, "group_id": 1, "parent_id": 5, "title": "Accusamus iste et ullam ratione voluptatem omnis debitis dolor est.", "description": "Molestias dolorem eos vitae expedita impedit necessitatibus quo voluptatum.", "author": { "id": 10, "name": "Lu Mayer", "username": "kam", "state": "active", "avatar_url": "http://www.gravatar.com/avatar/018729e129a6f31c80a6327a30196823?s=80&d=identicon", "web_url": "http://localhost:3001/kam" }, "start_date": null, "start_date_is_fixed": false, "start_date_fixed": null, "start_date_from_milestones": null, //deprecated in favor of start_date_from_inherited_source "start_date_from_inherited_source": null, "end_date": "2018-07-31", //deprecated in favor of due_date "due_date": "2018-07-31", "due_date_is_fixed": false, "due_date_fixed": null, "due_date_from_milestones": "2018-07-31", //deprecated in favor of start_date_from_inherited_source "due_date_from_inherited_source": "2018-07-31", "created_at": "2018-07-17T13:36:22.770Z", "updated_at": "2018-07-18T12:22:05.239Z", "labels": [] } ]

Assign a child epic

在两个史诗之间创建关联,将一个史诗指定为父史诗,将另一个史诗指定为子史诗. 父史诗可以有多个子史诗. 如果新的子史诗已经属于另一个史诗,则该子史诗不会从先前的父史诗中分配.

  1. POST /groups/:id/epics/:epic_iid/epics
Attribute Type Required Description
id integer/string yes The ID or URL-encoded path of the group owned by the authenticated user
epic_iid integer yes 史诗的内部 ID.
child_epic_id integer yes 子史诗的全局 ID. 内部 ID 无法使用,因为它们可能与其他组的史诗冲突.
  1. curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/epics/5/epics/6"

响应示例:

  1. { "id": 6, "iid": 38, "group_id": 1, "parent_id": 5 "title": "Accusamus iste et ullam ratione voluptatem omnis debitis dolor est.", "description": "Molestias dolorem eos vitae expedita impedit necessitatibus quo voluptatum.", "author": { "id": 10, "name": "Lu Mayer", "username": "kam", "state": "active", "avatar_url": "http://www.gravatar.com/avatar/018729e129a6f31c80a6327a30196823?s=80&d=identicon", "web_url": "http://localhost:3001/kam" }, "start_date": null, "start_date_is_fixed": false, "start_date_fixed": null, "start_date_from_milestones": null, //deprecated in favor of start_date_from_inherited_source "start_date_from_inherited_source": null, "end_date": "2018-07-31", //deprecated in favor of due_date "due_date": "2018-07-31", "due_date_is_fixed": false, "due_date_fixed": null, "due_date_from_milestones": "2018-07-31", //deprecated in favor of start_date_from_inherited_source "due_date_from_inherited_source": "2018-07-31", "created_at": "2018-07-17T13:36:22.770Z", "updated_at": "2018-07-18T12:22:05.239Z", "labels": [] }

Create and assign a child epic

创建一个新的史诗并将其与提供的父史诗相关联. 响应是 LinkedEpic 对象.

  1. POST /groups/:id/epics/:epic_iid/epics
Attribute Type Required Description
id integer/string yes 认证用户拥有的组的 ID 或URL 编码路径
epic_iid integer yes (未来父级)史诗的内部 ID.
title string yes 新创建的史诗的标题.
  1. curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/epics/5/epics?title=Newpic"

响应示例:

  1. { "id": 24, "iid": 2, "title": "child epic", "group_id": 49, "parent_id": 23, "has_children": false, "has_issues": false, "reference": "&2", "url": "http://localhost/groups/group16/-/epics/2", "relation_url": "http://localhost/groups/group16/-/epics/1/links/24" }

Re-order a child epic

  1. PUT /groups/:id/epics/:epic_iid/epics/:child_epic_id
Attribute Type Required Description
id integer/string yes 认证用户拥有的组的 ID 或URL 编码路径 .
epic_iid integer yes 史诗的内部 ID.
child_epic_id integer yes 子史诗的全局 ID. 内部 ID 无法使用,因为它们可能与其他组的史诗冲突.
move_before_id integer no 同胞史诗的全局 ID,应放在子史诗之前.
move_after_id integer no 同胞史诗的全局 ID,应放在子史诗之后.
  1. curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/epics/4/epics/5"

响应示例:

  1. [ { "id": 29, "iid": 6, "group_id": 1, "parent_id": 5, "title": "Accusamus iste et ullam ratione voluptatem omnis debitis dolor est.", "description": "Molestias dolorem eos vitae expedita impedit necessitatibus quo voluptatum.", "author": { "id": 10, "name": "Lu Mayer", "username": "kam", "state": "active", "avatar_url": "http://www.gravatar.com/avatar/018729e129a6f31c80a6327a30196823?s=80&d=identicon", "web_url": "http://localhost:3001/kam" }, "start_date": null, "start_date_is_fixed": false, "start_date_fixed": null, "start_date_from_milestones": null, //deprecated in favor of start_date_from_inherited_source "start_date_from_inherited_source": null, "end_date": "2018-07-31", //deprecated in favor of due_date "due_date": "2018-07-31", "due_date_is_fixed": false, "due_date_fixed": null, "due_date_from_milestones": "2018-07-31", //deprecated in favor of start_date_from_inherited_source "due_date_from_inherited_source": "2018-07-31", "created_at": "2018-07-17T13:36:22.770Z", "updated_at": "2018-07-18T12:22:05.239Z", "labels": [] } ]

Unassign a child epic

从父级史诗中取消分配子级史诗.

  1. DELETE /groups/:id/epics/:epic_iid/epics/:child_epic_id
Attribute Type Required Description
id integer/string yes 认证用户拥有的组的 ID 或URL 编码路径 .
epic_iid integer yes 史诗的内部 ID.
child_epic_id integer yes 子史诗的全局 ID. 内部 ID 无法使用,因为它们可能与其他组的史诗冲突.
  1. curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/epics/4/epics/5"

响应示例:

  1. { "id": 5, "iid": 38, "group_id": 1, "parent_id": null, "title": "Accusamus iste et ullam ratione voluptatem omnis debitis dolor est.", "description": "Molestias dolorem eos vitae expedita impedit necessitatibus quo voluptatum.", "author": { "id": 10, "name": "Lu Mayer", "username": "kam", "state": "active", "avatar_url": "http://www.gravatar.com/avatar/018729e129a6f31c80a6327a30196823?s=80&d=identicon", "web_url": "http://localhost:3001/kam" }, "start_date": null, "start_date_is_fixed": false, "start_date_fixed": null, "start_date_from_milestones": null, //deprecated in favor of start_date_from_inherited_source "start_date_from_inherited_source": null, "end_date": "2018-07-31", //deprecated in favor of due_date "due_date": "2018-07-31", "due_date_is_fixed": false, "due_date_fixed": null, "due_date_from_milestones": "2018-07-31", //deprecated in favor of start_date_from_inherited_source "due_date_from_inherited_source": "2018-07-31", "created_at": "2018-07-17T13:36:22.770Z", "updated_at": "2018-07-18T12:22:05.239Z", "labels": [] }