文档首页> 需求管理 CodeArts Req> API参考> API> Scrum项目的工作项> 查询当前工作项已经关联的代码提交记录 / 分支创建记录
更新时间:2024-03-07 GMT+08:00
分享

查询当前工作项已经关联的代码提交记录 / 分支创建记录

功能介绍

查询当前工作项已经关联的代码提交记录 / 分支创建记录

调用方法

请参见如何调用API

URI

GET /v4/projects/{project_id}/issues/{issue_id}/associated-commits

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

devcloud项目的32位id

最小长度:32

最大长度:32

issue_id

Integer

工作项ID

表2 Query参数

参数

是否必选

参数类型

描述

type

String

查询类型:commit(提交记录) || branch(分支记录)

limit

Integer

每页数量

offset

Integer

偏移量

请求参数

表3 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

最小长度:10

最大长度:32768

响应参数

状态码: 200

表4 响应Body参数

参数

参数类型

描述

commits

Array of CommitRecordDetail objects

提交记录列表

total

Integer

总数

表5 CommitRecordDetail

参数

参数类型

描述

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

更新时间

表6 SimpleUser

参数

参数类型

描述

user_num_id

Integer

用户数字id

user_id

String

用户uuid

user_name

String

账号名

nick_name

String

用户昵称

状态码: 400

表7 响应Body参数

参数

参数类型

描述

error_msg

String

错误描述

error_code

String

错误码

状态码: 401

表8 响应Body参数

参数

参数类型

描述

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

400

Bad Request

401

Unauthorized

错误码

请参见错误码

分享:

    相关文档

    相关产品