资源标记事件 API
- Tier: 基础版, 专业版, 旗舰版
- Offering: JihuLab.com, 私有化部署
资源标签事件记录了关于谁、何时以及哪个标签被添加到(或从)议题、合并请求或史诗中移除。
议题
列出项目议题标签事件
获取单个议题的所有标签事件列表。
plaintextGET /projects/:id/issues/:issue_iid/resource_label_events
| 属性 | 类型 | 必须 | 描述 |
|---|---|---|---|
| id | integer/string | yes | 项目的 ID 或 URL 编码的项目路径 |
| issue_iid | integer | yes | 议题的 IID |
json1[ 2 { 3 "id": 142, 4 "user": { 5 "id": 1, 6 "name": "Administrator", 7 "username": "root", 8 "state": "active", 9 "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", 10 "web_url": "http://gitlab.example.com/root" 11 }, 12 "created_at": "2018-08-20T13:38:20.077Z", 13 "resource_type": "Issue", 14 "resource_id": 253, 15 "label": { 16 "id": 73, 17 "name": "a1", 18 "color": "#34495E", 19 "description": "" 20 }, 21 "action": "add" 22 }, 23 { 24 "id": 143, 25 "user": { 26 "id": 1, 27 "name": "Administrator", 28 "username": "root", 29 "state": "active", 30 "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", 31 "web_url": "http://gitlab.example.com/root" 32 }, 33 "created_at": "2018-08-20T13:38:20.077Z", 34 "resource_type": "Issue", 35 "resource_id": 253, 36 "label": { 37 "id": 74, 38 "name": "p1", 39 "color": "#0033CC", 40 "description": "" 41 }, 42 "action": "remove" 43 } 44]
shellcurl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/issues/11/resource_label_events"
获取单个议题标签事件
返回特定项目议题的单个标签事件。
plaintextGET /projects/:id/issues/:issue_iid/resource_label_events/:resource_label_event_id
参数:
| 属性 | 类型 | 必须 | 描述 |
|---|---|---|---|
| id | integer/string | yes | 项目的 ID 或 URL 编码的项目路径 |
| issue_iid | integer | yes | 议题的 IID |
| resource_label_event_id | integer | yes | 标签事件的 ID |
shellcurl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/issues/11/resource_label_events/1"
史诗
- Tier: 专业版, 旗舰版
- Offering: JihuLab.com, 极狐GitLab私有化部署, 极狐GitLab Dedicated
史诗 REST API 在 极狐GitLab 17.0 中被弃用,计划在 API 的 v5 中移除。
列出群组史诗标签事件
获取单个史诗的所有标签事件列表。
plaintextGET /groups/:id/epics/:epic_id/resource_label_events
| 属性 | 类型 | 必须 | 描述 |
|---|---|---|---|
| id | integer/string | yes | 群组的 ID 或 URL 编码的群组路径 |
| epic_id | integer | yes | 史诗的 ID |
json1[ 2 { 3 "id": 106, 4 "user": { 5 "id": 1, 6 "name": "Administrator", 7 "username": "root", 8 "state": "active", 9 "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", 10 "web_url": "http://gitlab.example.com/root" 11 }, 12 "created_at": "2018-08-19T11:43:01.746Z", 13 "resource_type": "Epic", 14 "resource_id": 33, 15 "label": { 16 "id": 73, 17 "name": "a1", 18 "color": "#34495E", 19 "description": "" 20 }, 21 "action": "add" 22 }, 23 { 24 "id": 107, 25 "user": { 26 "id": 1, 27 "name": "Administrator", 28 "username": "root", 29 "state": "active", 30 "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", 31 "web_url": "http://gitlab.example.com/root" 32 }, 33 "created_at": "2018-08-19T11:43:01.746Z", 34 "resource_type": "Epic", 35 "resource_id": 33, 36 "label": { 37 "id": 37, 38 "name": "glabel2", 39 "color": "#A8D695", 40 "description": "" 41 }, 42 "action": "add" 43 } 44]
shellcurl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/epics/11/resource_label_events"
获取单个史诗标签事件
返回特定群组史诗的单个标签事件。
plaintextGET /groups/:id/epics/:epic_id/resource_label_events/:resource_label_event_id
参数:
| 属性 | 类型 | 必须 | 描述 |
|---|---|---|---|
| id | integer/string | yes | 群组的 ID 或 URL 编码的群组路径 |
| epic_id | integer | yes | 史诗的 ID |
| resource_label_event_id | integer | yes | 标签事件的 ID |
shellcurl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/epics/11/resource_label_events/107"
合并请求
列出项目合并请求标签事件
获取单个合并请求的所有标签事件列表。
plaintextGET /projects/:id/merge_requests/:merge_request_iid/resource_label_events
| 属性 | 类型 | 必须 | 描述 |
|---|---|---|---|
| id | integer/string | yes | 项目的 ID 或 URL 编码的项目路径 |
| merge_request_iid | integer | yes | 合并请求的 IID |
json1[ 2 { 3 "id": 119, 4 "user": { 5 "id": 1, 6 "name": "Administrator", 7 "username": "root", 8 "state": "active", 9 "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", 10 "web_url": "http://gitlab.example.com/root" 11 }, 12 "created_at": "2018-08-20T06:17:28.394Z", 13 "resource_type": "MergeRequest", 14 "resource_id": 28, 15 "label": { 16 "id": 74, 17 "name": "p1", 18 "color": "#0033CC", 19 "description": "" 20 }, 21 "action": "add" 22 }, 23 { 24 "id": 120, 25 "user": { 26 "id": 1, 27 "name": "Administrator", 28 "username": "root", 29 "state": "active", 30 "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", 31 "web_url": "http://gitlab.example.com/root" 32 }, 33 "created_at": "2018-08-20T06:17:28.394Z", 34 "resource_type": "MergeRequest", 35 "resource_id": 28, 36 "label": { 37 "id": 41, 38 "name": "project", 39 "color": "#D1D100", 40 "description": "" 41 }, 42 "action": "add" 43 } 44]
shellcurl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/merge_requests/11/resource_label_events"
获取单个合并请求标签事件
返回特定项目合并请求的单个标签事件。
plaintextGET /projects/:id/merge_requests/:merge_request_iid/resource_label_events/:resource_label_event_id
参数:
| 属性 | 类型 | 必须 | 描述 |
|---|---|---|---|
| id | integer/string | yes | 项目的 ID 或 URL 编码的项目路径 |
| merge_request_iid | integer | yes | 合并请求的 IID |
| resource_label_event_id | integer | yes | 标签事件的 ID |
shellcurl --request GET --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/merge_requests/11/resource_label_events/120"