查询当前工作项已经关联的代码提交记录 / 分支创建记录
功能介绍
查询当前工作项已经关联的代码提交记录 / 分支创建记录
URI
GET /v4/projects/{project_id}/issues/{issue_id}/associated-commits
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
project_id | 是 | String | devcloud项目的32位id |
issue_id | 是 | Integer | 工作项ID |
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
type | 否 | String | 查询类型:commit(提交记录) || branch(分支记录) |
limit | 否 | Integer | 每页数量 |
offset | 否 | Integer | 偏移量 |
请求参数
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
X-Auth-Token | 是 | String | 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 |
响应参数
状态码:200
参数 | 参数类型 | 描述 |
|---|---|---|
commits | Array of CommitRecordDetail objects | 提交记录列表 |
total | Integer | 总数 |
参数 | 参数类型 | 描述 |
|---|---|---|
repository_id | String | 仓库ID |
branch_name | String | 分支名称 |
commit_id | String | commit id |
commit_short_id | String | commit short id |
commit_msg | String | commit 信息 |
commit_url | String | commit URL |
user | SimpleUser object | 用户信息 |
type | String | 查询的类型 |
create_date | String | 创建时间 |
update_date | String | 更新时间 |
参数 | 参数类型 | 描述 |
|---|---|---|
user_num_id | Integer | 用户数字id |
user_id | String | 用户uuid |
user_name | String | 账号名 |
nick_name | String | 用户昵称 |
状态码:400
参数 | 参数类型 | 描述 |
|---|---|---|
error_msg | String | 错误描述 |
error_code | String | 错误码 |
状态码:401
参数 | 参数类型 | 描述 |
|---|---|---|
error_msg | String | 错误描述 |
error_code | String | 错误码 |
请求示例
GET https://{endpoint}/v4/projects/{project_id}/issues/{issue_id}/associated-commits
GET https://{endpoint}/v4/projects/a360371833bf4c558f796fd707b44daf/issues/122344/associated-commits 响应示例
状态码:200
{
"commits" : [ {
"repository_id" : "1865706",
"branch_name" : "master",
"commit_id" : "f608b02311d90f311c41711fdf67003c31305b89",
"commit_short_id" : "f608b023",
"commit_msg" : "demo",
"commit_url" : "https://xxx.xxx/xxxx/commit/791877f7d0e0b2032bc5e38425c1245e804e8741?ref=master",
"user" : {
"user_num_id" : 4091,
"user_id" : "a360371833bf4c558f796fd707b44daf",
"user_name" : "demo_user_name_xiongzhitest001",
"nick_name" : "bear"
},
"type" : "branch",
"create_date" : "2021-11-18 19:47:34",
"update_date" : "2021-11-18 19:47:34"
} ],
"total" : "success"
} 状态码
状态码 | 描述 |
|---|---|
200 | ok |
400 | Bad Request |
401 | Unauthorized |
错误码
请参见错误码。

