# 说明
批量保存并关联Commit数据,接口会解析commit message,绑定到对应的 需求、缺陷、任务上
# url
https://api.tapd.cn/code_commit_infos/batch_save_commit
# 支持格式
JSON/XML(默认JSON格式)
# HTTP请求方式
POST
# 请求参数
字段名 | 必选 | 类型及范围 | 说明 |
---|---|---|---|
git_env | 否 | string | 信息来源,支持类型为:github gitlab svn p4 默认gitlab |
commits | 是 | array | 提交信息 |
其中commits数组中每个commit对象字段说明如下:
字段名 | 必选 | 类型及范围 | 说明 |
---|---|---|---|
workspace_id | 是 | integer | 项目ID |
commit_id | 是 | string | 提交ID |
author | 是 | string | 代码提交人 |
message | 是 | string | 提交信息 |
files | 是 | array | 变更文件 |
repo | 是 | string | 仓库名 |
repo_id | 是 | string/integer | 仓库ID |
commit_time | 是 | string | 提交时间,2021-10-25 00:00:00 |
repo_url | 否 | string | 仓库链接,用户界面仓库跳转,留空则不提供跳转能力 |
commit_url | 否 | string | 提交链接,用户界面上commit提交跳转,留空则不提供跳转能力 |
# 返回结果
{
"status": 1,
"data": [
{
"id": "1020375571000321465",
"hook_user_name": "terrysxu",
"commit_id": "xxxxx",
"user_name": "",
"workspace_id": 20375571,
"message": "--story=854927829 ASA-c2s",
"path": "",
"web_url": "",
"hook_project_name": "repos/xxx_proj",
"commit_time": "2019-07-22 19:11:11 +0800 (Mon, 22 Jul 2019)",
"ref": "",
"git_env": "CodeGit",
"file_commit": "{\"U\":[\"xxx.php\"],\"A\":[\"xxx.js\"],\"M\":[\"xxx.html\"]}",
"repo_id": "abcd1234-avcd-1234-avcd-1234abcdefgh",
"related": [
{
"type": "story",
"object_id": "1020375571854927829",
"commit_id": "1020375571000321465",
"workspace_id": 20375571,
"code": "SUCCESS"
}
]
},
{
"id": "1020375571000321466",
"hook_user_name": "terrysxu",
"commit_id": "xxxxx",
"user_name": "",
"workspace_id": 20375571,
"message": "--story=854927829 ASA-c2s",
"path": "",
"web_url": "",
"hook_project_name": "repos/xxx_proj",
"commit_time": "2019-07-22 19:11:11 +0800 (Mon, 22 Jul 2019)",
"ref": "",
"git_env": "CodeGit",
"file_commit": "{\"U\":[\"xxx.php\"],\"A\":[\"xxx.js\"],\"M\":[\"xxx.html\"]}",
"repo_id": "abcd1234-avcd-1234-avcd-1234abcdefgh",
"related": [
{
"type": "story",
"object_id": "1020375571854927829",
"commit_id": "1020375571000321465",
"workspace_id": 20375571,
"code": "SUCCESS"
}
]
},
]
"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
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
# 字段说明
# 重要字段说明
字段名 | 说明 |
---|---|
commit_id | 提交的版本ID |
files | 变更文件,数组格式。通过空格分隔操作符和文件名。A表示添加的文件,U表示更新的文件,D表示删除的文件 |