PageRenderTime 43ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/doc/api/epic_links.md

https://gitlab.com/523/gitlab-ce
Markdown | 270 lines | 230 code | 40 blank | 0 comment | 0 complexity | 07fe47c1f132527efc7094aa12320778 MD5 | raw file
  1. ---
  2. stage: Plan
  3. group: Product Planning
  4. info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
  5. ---
  6. # Epic Links API **(ULTIMATE)**
  7. > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/9188) in GitLab 11.8.
  8. Manages parent-child [epic relationships](../user/group/epics/manage_epics.md#multi-level-child-epics).
  9. Every API call to `epic_links` must be authenticated.
  10. If a user is not a member of a private group, a `GET` request on that
  11. group results in a `404` status code.
  12. Multi-level Epics are available only in [GitLab Ultimate](https://about.gitlab.com/pricing/).
  13. If the Multi-level Epics feature is not available, a `403` status code is returned.
  14. ## List epics related to a given epic
  15. Gets all child epics of an epic.
  16. ```plaintext
  17. GET /groups/:id/epics/:epic_iid/epics
  18. ```
  19. | Attribute | Type | Required | Description |
  20. | ---------- | -------------- | -------- | ------------------------------------------------------------------------------------------------------------- |
  21. | `id` | integer/string | yes | The ID or [URL-encoded path of the group](index.md#namespaced-path-encoding) owned by the authenticated user |
  22. | `epic_iid` | integer | yes | The internal ID of the epic. |
  23. ```shell
  24. curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/epics/5/epics/"
  25. ```
  26. Example response:
  27. ```json
  28. [
  29. {
  30. "id": 29,
  31. "iid": 6,
  32. "group_id": 1,
  33. "parent_id": 5,
  34. "title": "Accusamus iste et ullam ratione voluptatem omnis debitis dolor est.",
  35. "description": "Molestias dolorem eos vitae expedita impedit necessitatibus quo voluptatum.",
  36. "author": {
  37. "id": 10,
  38. "name": "Lu Mayer",
  39. "username": "kam",
  40. "state": "active",
  41. "avatar_url": "http://www.gravatar.com/avatar/018729e129a6f31c80a6327a30196823?s=80&d=identicon",
  42. "web_url": "http://localhost:3001/kam"
  43. },
  44. "start_date": null,
  45. "start_date_is_fixed": false,
  46. "start_date_fixed": null,
  47. "start_date_from_milestones": null, //deprecated in favor of start_date_from_inherited_source
  48. "start_date_from_inherited_source": null,
  49. "end_date": "2018-07-31", //deprecated in favor of due_date
  50. "due_date": "2018-07-31",
  51. "due_date_is_fixed": false,
  52. "due_date_fixed": null,
  53. "due_date_from_milestones": "2018-07-31", //deprecated in favor of start_date_from_inherited_source
  54. "due_date_from_inherited_source": "2018-07-31",
  55. "created_at": "2018-07-17T13:36:22.770Z",
  56. "updated_at": "2018-07-18T12:22:05.239Z",
  57. "labels": []
  58. }
  59. ]
  60. ```
  61. ## Assign a child epic
  62. Creates an association between two epics, designating one as the parent epic and the other as the child epic. A parent epic can have multiple child epics. If the new child epic already belonged to another epic, it is unassigned from that previous parent.
  63. ```plaintext
  64. POST /groups/:id/epics/:epic_iid/epics/:child_epic_id
  65. ```
  66. | Attribute | Type | Required | Description |
  67. | --------------- | -------------- | -------- | ------------------------------------------------------------------------------------------------------------------ |
  68. | `id` | integer/string | yes | The ID or [URL-encoded path of the group](index.md#namespaced-path-encoding) owned by the authenticated user |
  69. | `epic_iid` | integer | yes | The internal ID of the epic. |
  70. | `child_epic_id` | integer | yes | The global ID of the child epic. Internal ID can't be used because they can conflict with epics from other groups. |
  71. ```shell
  72. curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/epics/5/epics/6"
  73. ```
  74. Example response:
  75. ```json
  76. {
  77. "id": 6,
  78. "iid": 38,
  79. "group_id": 1,
  80. "parent_id": 5,
  81. "title": "Accusamus iste et ullam ratione voluptatem omnis debitis dolor est.",
  82. "description": "Molestias dolorem eos vitae expedita impedit necessitatibus quo voluptatum.",
  83. "author": {
  84. "id": 10,
  85. "name": "Lu Mayer",
  86. "username": "kam",
  87. "state": "active",
  88. "avatar_url": "http://www.gravatar.com/avatar/018729e129a6f31c80a6327a30196823?s=80&d=identicon",
  89. "web_url": "http://localhost:3001/kam"
  90. },
  91. "start_date": null,
  92. "start_date_is_fixed": false,
  93. "start_date_fixed": null,
  94. "start_date_from_milestones": null, //deprecated in favor of start_date_from_inherited_source
  95. "start_date_from_inherited_source": null,
  96. "end_date": "2018-07-31", //deprecated in favor of due_date
  97. "due_date": "2018-07-31",
  98. "due_date_is_fixed": false,
  99. "due_date_fixed": null,
  100. "due_date_from_milestones": "2018-07-31", //deprecated in favor of start_date_from_inherited_source
  101. "due_date_from_inherited_source": "2018-07-31",
  102. "created_at": "2018-07-17T13:36:22.770Z",
  103. "updated_at": "2018-07-18T12:22:05.239Z",
  104. "labels": []
  105. }
  106. ```
  107. ## Create and assign a child epic
  108. Creates a new epic and associates it with provided parent epic. The response is LinkedEpic object.
  109. ```plaintext
  110. POST /groups/:id/epics/:epic_iid/epics
  111. ```
  112. | Attribute | Type | Required | Description |
  113. | --------------- | -------------- | -------- | ------------------------------------------------------------------------------------------------------------------ |
  114. | `id` | integer/string | yes | The ID or [URL-encoded path of the group](index.md#namespaced-path-encoding) owned by the authenticated user |
  115. | `epic_iid` | integer | yes | The internal ID of the (future parent) epic. |
  116. | `title` | string | yes | The title of a newly created epic. |
  117. | `confidential` | boolean | no | Whether the epic should be confidential. Parameter is ignored if `confidential_epics` feature flag is disabled. Defaults to the confidentiality state of the parent epic. |
  118. ```shell
  119. curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/epics/5/epics?title=Newpic"
  120. ```
  121. Example response:
  122. ```json
  123. {
  124. "id": 24,
  125. "iid": 2,
  126. "title": "child epic",
  127. "group_id": 49,
  128. "parent_id": 23,
  129. "has_children": false,
  130. "has_issues": false,
  131. "reference": "&2",
  132. "url": "http://localhost/groups/group16/-/epics/2",
  133. "relation_url": "http://localhost/groups/group16/-/epics/1/links/24"
  134. }
  135. ```
  136. ## Re-order a child epic
  137. ```plaintext
  138. PUT /groups/:id/epics/:epic_iid/epics/:child_epic_id
  139. ```
  140. | Attribute | Type | Required | Description |
  141. | ---------------- | -------------- | -------- | ------------------------------------------------------------------------------------------------------------------ |
  142. | `id` | integer/string | yes | The ID or [URL-encoded path of the group](index.md#namespaced-path-encoding) owned by the authenticated user. |
  143. | `epic_iid` | integer | yes | The internal ID of the epic. |
  144. | `child_epic_id` | integer | yes | The global ID of the child epic. Internal ID can't be used because they can conflict with epics from other groups. |
  145. | `move_before_id` | integer | no | The global ID of a sibling epic that should be placed before the child epic. |
  146. | `move_after_id` | integer | no | The global ID of a sibling epic that should be placed after the child epic. |
  147. ```shell
  148. curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/epics/4/epics/5"
  149. ```
  150. Example response:
  151. ```json
  152. [
  153. {
  154. "id": 29,
  155. "iid": 6,
  156. "group_id": 1,
  157. "parent_id": 5,
  158. "title": "Accusamus iste et ullam ratione voluptatem omnis debitis dolor est.",
  159. "description": "Molestias dolorem eos vitae expedita impedit necessitatibus quo voluptatum.",
  160. "author": {
  161. "id": 10,
  162. "name": "Lu Mayer",
  163. "username": "kam",
  164. "state": "active",
  165. "avatar_url": "http://www.gravatar.com/avatar/018729e129a6f31c80a6327a30196823?s=80&d=identicon",
  166. "web_url": "http://localhost:3001/kam"
  167. },
  168. "start_date": null,
  169. "start_date_is_fixed": false,
  170. "start_date_fixed": null,
  171. "start_date_from_milestones": null, //deprecated in favor of start_date_from_inherited_source
  172. "start_date_from_inherited_source": null,
  173. "end_date": "2018-07-31", //deprecated in favor of due_date
  174. "due_date": "2018-07-31",
  175. "due_date_is_fixed": false,
  176. "due_date_fixed": null,
  177. "due_date_from_milestones": "2018-07-31", //deprecated in favor of start_date_from_inherited_source
  178. "due_date_from_inherited_source": "2018-07-31",
  179. "created_at": "2018-07-17T13:36:22.770Z",
  180. "updated_at": "2018-07-18T12:22:05.239Z",
  181. "labels": []
  182. }
  183. ]
  184. ```
  185. ## Unassign a child epic
  186. Unassigns a child epic from a parent epic.
  187. ```plaintext
  188. DELETE /groups/:id/epics/:epic_iid/epics/:child_epic_id
  189. ```
  190. | Attribute | Type | Required | Description |
  191. | --------------- | -------------- | -------- | ------------------------------------------------------------------------------------------------------------------ |
  192. | `id` | integer/string | yes | The ID or [URL-encoded path of the group](index.md#namespaced-path-encoding) owned by the authenticated user. |
  193. | `epic_iid` | integer | yes | The internal ID of the epic. |
  194. | `child_epic_id` | integer | yes | The global ID of the child epic. Internal ID can't be used because they can conflict with epics from other groups. |
  195. ```shell
  196. curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/epics/4/epics/5"
  197. ```
  198. Example response:
  199. ```json
  200. {
  201. "id": 5,
  202. "iid": 38,
  203. "group_id": 1,
  204. "parent_id": null,
  205. "title": "Accusamus iste et ullam ratione voluptatem omnis debitis dolor est.",
  206. "description": "Molestias dolorem eos vitae expedita impedit necessitatibus quo voluptatum.",
  207. "author": {
  208. "id": 10,
  209. "name": "Lu Mayer",
  210. "username": "kam",
  211. "state": "active",
  212. "avatar_url": "http://www.gravatar.com/avatar/018729e129a6f31c80a6327a30196823?s=80&d=identicon",
  213. "web_url": "http://localhost:3001/kam"
  214. },
  215. "start_date": null,
  216. "start_date_is_fixed": false,
  217. "start_date_fixed": null,
  218. "start_date_from_milestones": null, //deprecated in favor of start_date_from_inherited_source
  219. "start_date_from_inherited_source": null,
  220. "end_date": "2018-07-31", //deprecated in favor of due_date
  221. "due_date": "2018-07-31",
  222. "due_date_is_fixed": false,
  223. "due_date_fixed": null,
  224. "due_date_from_milestones": "2018-07-31", //deprecated in favor of start_date_from_inherited_source
  225. "due_date_from_inherited_source": "2018-07-31",
  226. "created_at": "2018-07-17T13:36:22.770Z",
  227. "updated_at": "2018-07-18T12:22:05.239Z",
  228. "labels": []
  229. }
  230. ```