# 说明
返回指定Git分支关联的、指定类型的所有业务对象(分页显示,默认一页30条)
# url
https://apiv2.tapd.tencent.com/branch_object/workitems
# 支持格式
JSON/XML(默认JSON格式)
# HTTP请求方式
GET
# 请求数限制
默认返回 30 条。可通过传 limit 参数设置,最大取 200。也可以传 page 参数翻页
# 请求参数
字段名 | 必选 | 类型及范围 | 说明 | 特殊规则 |
---|---|---|---|---|
workspace_id | 是 | integer | 项目ID | |
branch | 是 | string | 分支名 | 支持多个分支,以逗号(,)隔开 |
repo_name | 是 | string | 仓库名 | 完整的仓库路径,如subgroup_name/sub1/sub2/repo_name |
entity_type | 是 | string | 业务对象类型 | story-需求,bug-缺陷,task-任务 |
flag | 否 | string | 区分是否通过commit 间接查询 | flag=commit 表示通过commit间接查询获得相关业务对象,否则直接查询与branch关联的业务对象 |
limit | 否 | integer | 设置返回数量限制,默认为30 | |
page | 否 | integer | 返回当前数量限制下第N页的数据,默认为1(第一页) | |
order | 否 | string | 排序规则,规则:字段名 ASC或者DESC,然后 urlencode | 如按创建时间逆序:order=created%20desc |
fields | 否 | string | 设置获取的字段,多个字段间以','逗号隔开 |
# 调用示例及返回结果
# 获取关联的需求
# curl 使用 Basic Auth 鉴权调用示例
curl -u 'api_user:api_password' 'https://apiv2.tapd.tencent.com/branch_object/workitems?branch=test&repo_name=test&entity_type=story'
# curl 使用 OAuth Access Token 鉴权调用示例
curl -H 'Authorization: Bearer ACCESS_TOKEN' 'https://apiv2.tapd.tencent.com/branch_object/workitems?branch=test&repo_name=test&entity_type=story'
# 返回结果
# 有commit_id参数
{
"status": 1,
"data": [
{
"Story": {
"id": "1000000755500689371",
"name": "分支测试数据不允许删除",
"description": "<style></style><div data-sign=\"68b329da9893e34099c7d8ad5cb9c940\" id=\"show-markdown-wrap\"></div>",
"workspace_id": "755",
"creator": "lincolnzhou",
"created": "2019-07-11 16:29:23",
"modified": "2019-08-08 16:56:34",
"status": "planning",
"owner": "haitqin;",
"cc": "",
"begin": null,
"due": null,
"size": null,
"priority": "4",
"developer": null,
"iteration_id": "1000000755000578153",
"test_focus": null,
"type": "",
"source": null,
"module": "",
"version": "",
"completed": null,
"category_id": "-1",
"path": "1000000755500689371:",
"parent_id": "0",
"children_id": "|",
"ancestor_id": "1000000755500689371",
"business_value": null,
"effort": "0",
"effort_completed": "0",
"exceed": "0",
"remain": "0",
"release_id": "0",
"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,
"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": "",
"custom_field_37": "",
"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": "",
"custom_field_51": null,
"custom_field_52": null,
"custom_field_53": "",
"custom_field_54": null,
"custom_field_55": null,
"custom_field_56": null,
"custom_field_57": null,
"custom_field_58": "",
"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
}
}
],
"info": "success"
}
1
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
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
# 无commit_id参数
{
"status": 1,
"data": [
{
"Story": {
"id": "1010158231500625837",
"issue_type":"",
"issue_id":"",
"issue_title":"",
"workspace_id":"755",
"name": "官网案例页建设",
"description": null,
"creator": "anyechen",
"created": "2017-06-12 00:00:59",
"modified": "2017-06-12 00:00:59",
"status": "resolved",
"owner": null,
"cc": null,
"begin": "2017-06-26",
"due": "2017-07-07",
"size": "2",
"priority": "3",
"developer": null,
"iteration_id": "1010158231000388075",
"test_focus": null,
"type": null,
"source": null,
"module": null,
"version": "",
"completed": "2017-06-27 09:00:00",
"category_id": "1010158231000077717",
"parent_id": "1010158231500625825",
"children_id": "|",
"ancestor_id": "1010158231500625825",
"business_value": null,
"effort": "0",
"effort_completed": "0",
"exceed": "0",
"remain": "0",
"release_id": "1010158231100000905",
"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,
"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
}
},
{
"Story": {
"id": "1010158231500625835",
"name": "官网首页建设",
"description": "<div><b><span style=\"color: rgb(68, 68, 68);\">【用户故事(User Story)】<\/span><br \/><\/b><\/div><b style=\" color: rgb(54, 59, 66) ; ; ; ; ; ; ; ; ; ; ; ;\"><span style=\"color: rgb(255, 0, 0);\"><div><b style=\"color: rgb(54, 59, 66);\"><span style=\"color: rgb(255, 0, 0);\"><br \/><\/span><\/b><\/div>作为<\/span><\/b><span style=\" color: rgb(54, 59, 66) ; ; ; ; ; ; ; ; ; ; ; ;\"> 新产品的目<\/span><span style=\" ; ; ; ; ; ; ; \"><span style=\"color:#444444;\">标用户<\/span><\/span><div style=\" margin: 0px; padding: 0px ; ; ; ; ; ; ; ; ; ; ; ;\"><span style=\"color:#363b42;\"> <\/span><div style=\"margin: 0px; padding: 0px;\"><div style=\"color: rgb(54, 59, 66); margin: 0px; padding: 0px;\"><b><span style=\"color: rgb(255, 0, 0);\">我希望<\/span><\/b> 网站首页提供基本的企业与产品介绍<\/div><div style=\"color: rgb(54, 59, 66); margin: 0px; padding: 0px;\"><br \/><\/div><div style=\"color: rgb(54, 59, 66); margin: 0px; padding: 0px;\"><b><span style=\"color: rgb(255, 0, 0);\">以便<\/span><\/b> 我能对产品有一个初步了解<\/div><div style=\"color: rgb(54, 59, 66); margin: 0px; padding: 0px;\"><br \/><\/div><div style=\"margin: 0px; padding: 0px;\"><b><span style=\"color:#363b42;\">【<\/span><span style=\"color:#444444;\">验收标准<\/span><span style=\"color:#363b42;\">】<\/span><\/b><\/div><div style=\"color: rgb(54, 59, 66); margin: 0px; padding: 0px;\"><br \/><\/div><div style=\"color: rgb(54, 59, 66); margin: 0px; padding: 0px;\">1、<\/div><div style=\"color: rgb(54, 59, 66); margin: 0px; padding: 0px;\">2、<\/div><div style=\"color: rgb(54, 59, 66); margin: 0px; padding: 0px;\">3、<\/div><\/div><\/div>",
"workspace_id": "10158231",
"creator": "anyechen",
"created": "2017-06-12 00:00:40",
"modified": "2018-01-02 16:11:32",
"status": "developing",
"owner": null,
"cc": null,
"begin": "2017-06-12",
"due": "2017-06-23",
"size": "2",
"priority": "4",
"developer": null,
"iteration_id": "1010158231000388073",
"test_focus": null,
"type": null,
"source": null,
"module": null,
"version": "",
"completed": "2017-06-12 11:00:00",
"category_id": "1010158231000077715",
"parent_id": "1010158231500625825",
"children_id": "|",
"ancestor_id": "1010158231500625825",
"business_value": null,
"effort": "0",
"effort_completed": "0",
"exceed": "0",
"remain": "0",
"release_id": "1010158231100000905",
"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,
"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": "yes"
}
}
],
"info": "success"
}
1
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
# 需求字段说明
请参考 获取需求
# 缺陷字段说明
请参考 获取缺陷
# 任务字段说明
请参考 获取任务