# 说明
获取TAPD业务对象与Git业务对象(mr/cr/issue)的关联关系信息。 返回关联数据只包含关联的对象(mr/cr/issue)的id,需要单独从对应的Git系统中获取具体的 cr/issue/mr信息。
# url
https://apiv2.tapd.tencent.com/third_relations
# HTTP请求方式
GET
# 支持格式
JSON/XML(默认JSON格式)
# HTTP请求方式
GET
# 请求数限制
一次只能获取一个Git 业务对象与TAPD业务对象的关联关系 通过Git 数据查tapd数据:
# 请求参数
字段名 | 必选 | 类型 | 说明 | 特殊规则 |
---|---|---|---|---|
source_type | 是 | string | Git 资源类型 | 目前type可选值:mr,cr,issue |
source_project_id | 是 | int | Git 项目id | |
source_id | 是 | int | Git MR\CR\ISSUE的iid |
通过tapd数据查Git 数据:
字段名 | 必选 | 类型 | 说明 | 特殊规则 |
---|---|---|---|---|
source_type | 是 | string | Git 资源类型 | 目前type可选值:mr,cr,issue |
workspace_id | 是 | int | tapd项目id | |
tapd_id | 是 | int | tapd对象id | |
tapd_type | 是 | string | tapd对象类型 | 目前可选值:story,task,bug |
# 调用示例及返回结果
# curl 使用 Basic Auth 鉴权调用示例
curl -u 'api_user:api_password' -d 'source_type=issue&source_project_id=10220750&source_id=9999' '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&source_id=9999' 'https://apiv2.tapd.tencent.com/third_relations'
# 获取MR关联对象 调用示例
# curl 使用 Basic Auth 鉴权调用示例
curl -u 'api_user:api_password' -d 'source_type=mr&source_project_id=10220750&source_id=9999' 'https://apiv2.tapd.woa.com//third_relations'
# curl 使用 OAuth Access Token 鉴权调用示例
curl -H 'Authorization: Bearer ACCESS_TOKEN' -d 'source_type=mr&source_project_id=10220750&source_id=9999' 'https://apiv2.tapd.woa.com//third_relations'
# 返回结果
{
"status": 1,
"data": {
"ThirdRelations": [
{
"id": "644",
"workspace_id": "20358496",
"source_app_id": "1",
"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",
"entity_info": {
"id": "1020358496854819049",
"workitem_type_id": "0",
"name": "0831 isseu 需求",
"description": "<b><span style=\"color:#ff0000;\">作为</span></b> <div> <div><div><b><span style=\"color:#ff0000;\">我希望</span></b> </div><div><br /> </div><div><b><span style=\"color:#ff0000;\">以便</span></b> </div><div><br /> </div><div>【验收标准】</div><div>1、</div><div>2、</div><div>3、</div><div><br /> </div></div></div>",
"markdown_description": null,
"description_type": "1",
"creator": "fredgui",
"created": "2020-08-31 16:44:06",
"modified": "2020-09-01 15:08:38",
"parent_id": "0",
"children_id": "|",
"ancestor_id": "1020358496854819049",
"path": "1020358496854819049:",
"level": "0",
"workspace_id": "20358496",
"status": "resolved",
"flows": null,
"priority": "",
"owner": "fredgui;",
"participator": ";fredgui",
"cc": null,
"begin": null,
"due": null,
"source": null,
"workitem_id": null,
"iteration_id": "0",
"issue_id": null,
"support_id": null,
"support_forum_id": null,
"module": null,
"completed": "2020-09-01 15:08:38",
"templated_id": "1020358496000061573",
"delay_count": null,
"type": null,
"status_append": null,
"business_value": null,
"tech_risk": null,
"size": "0",
"import_flag": "0",
"effort": "0",
"effort_completed": "0",
"exceed": "0",
"remain": "0",
"progress": "0",
"release_id": "0",
"feature": "",
"entity_type": "Story",
"custom_field_one": null,
"custom_field_two": null,
"custom_field_three": null,
"custom_field_four": null,
"custom_field_five": null,
"custom_field_six": null,
"custom_field_seven": null,
"custom_field_eight": null,
"attachment_count": "0",
"developer": null,
"bug_id": null,
"test_focus": null,
"category_id": "-1",
"version": "",
"confidential": "N",
"created_from": null,
"follower": "",
"sync_type": null,
"predecessor_count": "0",
"custom_field_9": null,
"custom_field_10": null,
"custom_field_11": null,
"custom_field_12": null,
"custom_field_13": null,
"custom_field_14": null,
"custom_field_15": null,
"custom_field_16": null,
"custom_field_17": null,
"custom_field_18": null,
"custom_field_19": null,
"custom_field_20": null,
"custom_field_21": "",
"custom_field_22": "",
"custom_field_23": "",
"custom_field_24": "",
"custom_field_25": "",
"custom_field_26": "",
"custom_field_27": "",
"custom_field_28": "",
"custom_field_29": "",
"custom_field_30": "",
"custom_field_31": null,
"custom_field_32": null,
"custom_field_33": null,
"custom_field_34": null,
"custom_field_35": null,
"custom_field_36": null,
"custom_field_37": null,
"custom_field_38": null,
"custom_field_39": null,
"custom_field_40": null,
"custom_field_41": null,
"custom_field_42": null,
"custom_field_43": null,
"custom_field_44": null,
"custom_field_45": null,
"custom_field_46": null,
"custom_field_47": null,
"custom_field_48": null,
"custom_field_49": null,
"custom_field_50": null,
"custom_field_51": null,
"custom_field_52": null,
"custom_field_53": null,
"custom_field_54": null,
"custom_field_55": null,
"custom_field_56": null,
"custom_field_57": null,
"custom_field_58": null,
"custom_field_59": null,
"custom_field_60": null,
"custom_field_61": null,
"custom_field_62": null,
"custom_field_63": null,
"custom_field_64": null,
"custom_field_65": null,
"custom_field_66": null,
"custom_field_67": null,
"custom_field_68": null,
"custom_field_69": null,
"custom_field_70": null,
"custom_field_71": null,
"custom_field_72": null,
"custom_field_73": null,
"custom_field_74": null,
"custom_field_75": null,
"custom_field_76": null,
"custom_field_77": null,
"custom_field_78": null,
"custom_field_79": null,
"custom_field_80": null,
"custom_field_81": null,
"custom_field_82": null,
"custom_field_83": null,
"custom_field_84": null,
"custom_field_85": null,
"custom_field_86": null,
"custom_field_87": null,
"custom_field_88": null,
"custom_field_89": null,
"custom_field_90": null,
"custom_field_91": null,
"custom_field_92": null,
"custom_field_93": null,
"custom_field_94": null,
"custom_field_95": null,
"custom_field_96": null,
"custom_field_97": null,
"custom_field_98": null,
"custom_field_99": null,
"custom_field_100": null,
"successor_count": "0"
}
}
]
},
"info": "success"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# 字段说明
# 关联关系字段说明
字段 | 说明 |
---|---|
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 | 关联状态 |
source_iid | 内部保留字段,请忽略 |