# 说明
创建TAPD业务对象与Git 业务对象(mr/cr/issue)的关联关系,返回关系数据
# url
https://apiv2.tapd.tencent.com/third_relations
# HTTP请求方式
POST
# 请求限制
每次请求操作只允许一个业务对象和一个issue关联
# 请求参数
字段名 | 必选 | 类型 | 说明 | 特殊规则 |
---|---|---|---|---|
source_type | 是 | string | 资源类型 | 目前source_type可选值:mr,cr,issue |
source_project_id | 是 | int | Git 项目id | |
tgit_id | 否 | int | Git MR/CR/Issue的id | |
source_id | 是 | int | Git MR/CR/Issue 的iid | |
workspace_id | 是 | int | tapd项目id | |
tapd_id | 是 | string | tapd业务对象id | |
tapd_type | 是 | string | tapd业务对象类型 | 目前tapd_type可选值:task,story,bug |
operator | 是 | string | 操作人 | 英文名,如dobbyzhang |
scm_type | 否 | string | 指令类型,默认值tgit | 可选值:tgit,tsvn,p4,gitlab,github |
# 调用示例及返回结果
# curl 使用 Basic Auth 鉴权调用示例
curl -u 'api_user:api_password' -d 'source_type=issue&source_project_id=10220750&tgit_id=9999&source_id=89888&workspace_id=20358496&tapd_id=1020358496854819049&tapd_type=story' 'https://apiv2.tapd.tencent.com/third_relations'
# curl 使用 OAuth Access Token 鉴权调用示例
curl -H 'Authorization: Bearer ACCESS_TOKEN' -d 'source_type=issue&source_project_id=10220750&tgit_id=9999&source_id=89888&workspace_id=20358496&tapd_id=1020358496854819049&tapd_type=story' 'https://apiv2.tapd.tencent.com/third_relations'
# 返回结果
{
"status": 1,
"data": {
"ThirdRelations": {
"id": "644",
"workspace_id": "20358496",
"source_project_id": "10220750",
"source_id": "77",
"source_iid": "600",
"source_type": "issue",
"tapd_id": "1020358496854819049",
"tapd_type": "story",
"created": "2020-09-01 17:34:54",
"modified": "2020-09-01 17:34:54",
"status": "1",
"tgit_id": "600"
}
},
"info": "success"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 字段说明
# 关联关系字段说明
字段 | 说明 |
---|---|
id | 关联ID |
workspace_id | 项目ID |
source_project_id | Git 资源项目ID |
tgit_id | Git MR/CR/Issue的id |
source_id | Git MR/CR/Issue的iid |
source_type | Git 资源类型 |
tapd_id | tapd对象ID |
tapd_type | tapd对象类型 |
created | 创建时间 |
modified | 修改时间 |
status | 关联状态 |