이슈 링크 API
Tier: Free, Premium, Ultimate
Offering: GitLab.com, Self-managed, GitLab Dedicated
- 간단한 “관련된” 관계 이동 – GitLab Free 13.4에서 이동하였습니다.
이슈 관계 디렉터리
주어진 이슈의 연결된 이슈를 가져와서, 관계 생성 일시(오름차순)에 따라 정렬된 디렉터리을 얻습니다. 이슈는 사용자 권한에 따라 필터링됩니다.
GET /projects/:id/issues/:issue_iid/links
매개변수:
속성 | 유형 | 필수 여부 | 설명 |
---|---|---|---|
id
| integer/string | 예 | 인증된 사용자가 소유한 프로젝트의 ID 또는 URL로 인코딩된 경로 |
issue_iid
| integer | 예 | 프로젝트의 이슈의 내부 ID |
[
{
"id" : 84,
"iid" : 14,
"issue_link_id": 1,
"project_id" : 4,
"created_at" : "2016-01-07T12:44:33.959Z",
"title" : "인증 관련 이슈",
"state" : "열림",
"assignees" : [],
"assignee" : null,
"labels" : [
"버그"
],
"author" : {
"name" : "Alexandra Bashirian",
"avatar_url" : null,
"state" : "활성",
"web_url" : "https://gitlab.example.com/eileen.lowe",
"id" : 18,
"username" : "eileen.lowe"
},
"description" : null,
"updated_at" : "2016-01-07T12:44:33.959Z",
"milestone" : null,
"user_notes_count": 0,
"due_date": null,
"web_url": "http://example.com/example/example/issues/14",
"confidential": false,
"weight": null,
"link_type": "관련됨",
"link_created_at": "2016-01-07T12:44:33.959Z",
"link_updated_at": "2016-01-07T12:44:33.959Z"
}
]
이슈 링크 가져오기
- GitLab 15.1에서 소개되었습니다.
이슈 링크에 대한 세부 정보를 가져옵니다.
GET /projects/:id/issues/:issue_iid/links/:issue_link_id
지원되는 속성:
속성 | 유형 | 필수 여부 | 설명 |
---|---|---|---|
id
| integer/string | 예 | 프로젝트의 ID 또는 URL로 인코딩된 경로 |
issue_iid
| integer | 예 | 프로젝트의 이슈의 내부 ID |
issue_link_id
| integer/string | 예 | 이슈 관계의 ID |
응답 본문 속성:
속성 | 유형 | 설명 |
---|---|---|
source_issue
| object | 관계의 원본 이슈의 세부 정보 |
target_issue
| object | 관계의 대상 이슈의 세부 정보 |
link_type
| string | 관계 유형. 가능한 값은 관련됨 , 차단 , 차단됨
|
예시 요청:
curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/84/issues/14/links/1"
예시 응답:
{
"source_issue" : {
"id" : 83,
"iid" : 11,
"project_id" : 4,
"created_at" : "2016-01-07T12:44:33.959Z",
"title" : "인증 관련 이슈",
"state" : "열림",
"assignees" : [],
"assignee" : null,
"labels" : [
"버그"
],
"author" : {
"name" : "Alexandra Bashirian",
"avatar_url" : null,
"state" : "활성",
"web_url" : "https://gitlab.example.com/eileen.lowe",
"id" : 18,
"username" : "eileen.lowe"
},
"description" : null,
"updated_at" : "2016-01-07T12:44:33.959Z",
"milestone" : null,
"subscribed" : true,
"user_notes_count": 0,
"due_date": null,
"web_url": "http://example.com/example/example/issues/11",
"confidential": false,
"weight": null
},
"target_issue" : {
"id" : 84,
"iid" : 14,
"project_id" : 4,
"created_at" : "2016-01-07T12:44:33.959Z",
"title" : "인증 관련 이슈",
"state" : "열림",
"assignees" : [],
"assignee" : null,
"labels" : [
"버그"
],
"author" : {
"name" : "Alexandra Bashirian",
"avatar_url" : null,
"state" : "활성",
"web_url" : "https://gitlab.example.com/eileen.lowe",
"id" : 18,
"username" : "eileen.lowe"
},
"description" : null,
"updated_at" : "2016-01-07T12:44:33.959Z",
"milestone" : null,
"subscribed" : true,
"user_notes_count": 0,
"due_date": null,
"web_url": "http://example.com/example/example/issues/14",
"confidential": false,
"weight": null
},
"link_type": "관련됨"
}
이슈 링크 생성
두 개의 이슈 간에 양방향 관계를 생성합니다. 사용자는 양쪽 이슈를 모두 업데이트할 수 있어야 성공합니다.
POST /projects/:id/issues/:issue_iid/links
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id
| integer/string | yes | 인증된 사용자가 소유한 프로젝트의 ID 또는 URL-encoded된 경로 |
issue_iid
| integer | yes | 프로젝트의 내부 ID |
target_project_id
| integer/string | yes | 대상 프로젝트의 ID 또는 URL-encoded된 경로 |
target_issue_iid
| integer/string | yes | 대상 프로젝트의 내부 ID |
link_type
| string | no | 관계 유형 (relates_to , blocks , is_blocked_by )입니다. 기본값은 relates_to 입니다.
|
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/4/issues/1/links?target_project_id=5&target_issue_iid=1"
예시 응답:
{
"source_issue" : {
"id" : 83,
"iid" : 11,
"project_id" : 4,
"created_at" : "2016-01-07T12:44:33.959Z",
"title" : "Issues with auth",
"state" : "opened",
"assignees" : [],
"assignee" : null,
"labels" : [
"bug"
],
"author" : {
"name" : "Alexandra Bashirian",
"avatar_url" : null,
"state" : "active",
"web_url" : "https://gitlab.example.com/eileen.lowe",
"id" : 18,
"username" : "eileen.lowe"
},
"description" : null,
"updated_at" : "2016-01-07T12:44:33.959Z",
"milestone" : null,
"subscribed" : true,
"user_notes_count": 0,
"due_date": null,
"web_url": "http://example.com/example/example/issues/11",
"confidential": false,
"weight": null
},
"target_issue" : {
"id" : 84,
"iid" : 14,
"project_id" : 4,
"created_at" : "2016-01-07T12:44:33.959Z",
"title" : "Issues with auth",
"state" : "opened",
"assignees" : [],
"assignee" : null,
"labels" : [
"bug"
],
"author" : {
"name" : "Alexandra Bashirian",
"avatar_url" : null,
"state" : "active",
"web_url" : "https://gitlab.example.com/eileen.lowe",
"id" : 18,
"username" : "eileen.lowe"
},
"description" : null,
"updated_at" : "2016-01-07T12:44:33.959Z",
"milestone" : null,
"subscribed" : true,
"user_notes_count": 0,
"due_date": null,
"web_url": "http://example.com/example/example/issues/14",
"confidential": false,
"weight": null
},
"link_type": "relates_to"
}
이슈 링크 삭제
이슈 링크를 삭제하여 양방향 관계를 제거합니다.
DELETE /projects/:id/issues/:issue_iid/links/:issue_link_id
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id
| integer/string | yes | 인증된 사용자가 소유한 프로젝트의 ID 또는 URL-encoded된 경로 |
issue_iid
| integer | yes | 프로젝트의 내부 ID |
issue_link_id
| integer/string | yes | 이슈 관계의 ID |
link_type
| string | no | 관계 유형 (relates_to , blocks , is_blocked_by )입니다. 기본값은 relates_to 입니다.
|
{
"source_issue" : {
"id" : 83,
"iid" : 11,
"project_id" : 4,
"created_at" : "2016-01-07T12:44:33.959Z",
"title" : "Issues with auth",
"state" : "opened",
"assignees" : [],
"assignee" : null,
"labels" : [
"bug"
],
"author" : {
"name" : "Alexandra Bashirian",
"avatar_url" : null,
"state" : "active",
"web_url" : "https://gitlab.example.com/eileen.lowe",
"id" : 18,
"username" : "eileen.lowe"
},
"description" : null,
"updated_at" : "2016-01-07T12:44:33.959Z",
"milestone" : null,
"subscribed" : true,
"user_notes_count": 0,
"due_date": null,
"web_url": "http://example.com/example/example/issues/11",
"confidential": false,
"weight": null
},
"target_issue" : {
"id" : 84,
"iid" : 14,
"project_id" : 4,
"created_at" : "2016-01-07T12:44:33.959Z",
"title" : "Issues with auth",
"state" : "opened",
"assignees" : [],
"assignee" : null,
"labels" : [
"bug"
],
"author" : {
"name" : "Alexandra Bashirian",
"avatar_url" : null,
"state" : "active",
"web_url" : "https://gitlab.example.com/eileen.lowe",
"id" : 18,
"username" : "eileen.lowe"
},
"description" : null,
"updated_at" : "2016-01-07T12:44:33.959Z",
"milestone" : null,
"subscribed" : true,
"user_notes_count": 0,
"due_date": null,
"web_url": "http://example.com/example/example/issues/14",
"confidential": false,
"weight": null
},
"link_type": "relates_to"
}