# 说明
获取指定commit关联的业务对象
# url
https://api.tapd.cn/code_commit_objects/workitems
# HTTP请求方式
GET
# 请求数限制
默认返回 30 条。可通过传 limit 参数设置,最大取 200。也可以传 page 参数翻页
# 请求参数
字段名 | 必选 | 类型及范围 | 说明 | 特殊规则 |
---|---|---|---|---|
workspace_id | 是 | integer | 项目ID | |
commit_id | 是 | string | 提交ID | 支持多个commit,以逗号(,)隔开 |
entity_type | 是 | string | 业务对象类型 | story-需求,bug-缺陷,task-任务 |
scm_type | 否 | string | 来源类型默认"p4"候选值"tgit,云端有gitlab,github,tgit" | |
limit | 否 | integer | 设置返回数量限制,默认为30 | |
page | 否 | integer | 返回当前数量限制下第N页的数据,默认为1(第一页) | |
order | 否 | string | 排序规则,规则:字段名 ASC或者DESC,然后 urlencode | 如按创建时间逆序:order=created%20desc |
fields | 否 | string | 设置获取的字段,多个字段间以','逗号隔开 |
# 调用示例及返回结果
curl -H 'Authorization: Bearer Access Token' -X GET 'https://api.tapd.cn/code_commit_objects/workitems?commit_id=7b0645c6a467a502fe1d3b678fea8bdf2890aa8d&entity_type=story&workspace_id=20355782'
# 返回结果
{
"status": 1,
"data": [
{
"Task": {
"id": "1020355782500602947",
"name": "666",
"description": null,
"workspace_id": "20355782",
"creator": "v_tingtdong",
"created": "2019-10-30 16:26:45",
"modified": "2019-10-30 16:26:45",
"status": "open",
"owner": "",
"cc": "",
"begin": null,
"due": null,
"story_id": "1020355782500697089",
"iteration_id": "1020355782000390769",
"priority": "",
"progress": "0",
"completed": null,
"effort_completed": "0",
"exceed": "0",
"remain": "0",
"effort": "0",
"has_attachment": "0",
"release_id": "1020355782500697089",
"label": null,
"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": "",
"custom_field_10": "",
"custom_field_11": "",
"custom_field_12": "",
"custom_field_13": "",
"custom_field_14": "",
"custom_field_15": "",
"custom_field_16": "",
"custom_field_17": "",
"custom_field_18": "",
"custom_field_19": "",
"custom_field_20": "",
"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": "",
"custom_field_32": "",
"custom_field_33": "",
"custom_field_34": "",
"custom_field_35": "",
"custom_field_36": "",
"custom_field_37": "",
"custom_field_38": "",
"custom_field_39": "",
"custom_field_40": "",
"custom_field_41": "",
"custom_field_42": "",
"custom_field_43": "",
"custom_field_44": "",
"custom_field_45": "",
"custom_field_46": "",
"custom_field_47": "",
"custom_field_48": "",
"custom_field_49": "",
"custom_field_50": ""
}
}
],
"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
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
# 需求字段说明
请参考 获取需求
# 缺陷字段说明
请参考 获取缺陷
# 任务字段说明
请参考 获取任务