# 说明
获取工作项和Git分支的关联关系
# url
https://apiv2.tapd.tencent.com/branch_object
# 支持格式
JSON/XML(默认JSON格式)
# HTTP请求方式
GET
# 请求数限制
获取所有关联数据
# 请求参数
字段名 | 必选 | 类型及范围 | 说明 |
---|---|---|---|
workspace_id | 是 | integer | 项目ID |
type | 是 | string | TAPD业务对象类型(mini_item) |
object_id | 否 | int | 工作项ID |
branch | 否 | string | 分支名 |
repo_name | 否 | string | 仓库名 |
branch_status | 否 | int | 分支状态(0:正常,1:已删除) |
created | 否 | datetime | 创建时间 |
# 调用示例及返回结果
# 获取工作项和Git分支的关联关系
# curl 使用 Basic Auth 鉴权调用示例
curl -u 'api_user:api_password' 'https://apiv2.tapd.tencent.com/branch_object?workspace_id=69993260&object_id=1069993260856110919'
# curl 使用 OAuth Access Token 鉴权调用示例
curl -H 'Authorization: Bearer ACCESS_TOKEN' 'https://apiv2.tapd.tencent.com/branch_object?workspace_id=69993260&object_id=1069993260856110919'
# 返回结果
{
"status": 1,
"data": [
{
"CodeBranchObjects": {
"id": "1069993260000032185",
"workspace_id": "69993260",
"type": "mini_item",
"object_id": "1069993260856110919",
"repo_id": "11421734",
"repo_name": "orangecyang/mini_project_git",
"repo_url": "https://test.git.woa.com/orangecyang/mini_project_git",
"branch": "refs/heads/test",
"branch_status": "0",
"create_from": "master",
"operator": "orangecyang",
"created": "2023-07-19 12:21:18"
}
}
],
"info": "success"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22