# 说明

获取TAPD对象和Git分支的关联关系

# url

https://apiv2.tapd.tencent.com/branch_object

# 支持格式

JSON/XML(默认JSON格式)

# HTTP请求方式

GET

# 请求数限制

获取所有关联数据

# 请求参数

字段名 必选 类型及范围 说明
workspace_id integer 项目ID
type string TAPD业务对象类型(story、bug、task)
object_id int TAPD业务对象ID
branch string 分支名
repo_name string 仓库名
branch_status int 分支状态(0:正常,1:已删除)
created datetime 创建时间

# 调用示例及返回结果

# 获取TAPD对象和Git分支的关联关系

# curl 使用 Basic Auth 鉴权调用示例

curl -u 'api_user:api_password' 'https://apiv2.tapd.tencent.com/branch_object?workspace_id=755&type=story&object_id=1000000755500695069'

# curl 使用 OAuth Access Token 鉴权调用示例

curl -H 'Authorization: Bearer ACCESS_TOKEN' 'https://apiv2.tapd.tencent.com/branch_object?workspace_id=755&type=story&object_id=1000000755500695069'

# 返回结果

{
	"status": 1,
	"data": {
	"CodeBranchObjects": [
		{
			"id": "1000000755000000611",
			"workspace_id": "755",
			"type": "story",
			"object_id": "1000000755500695069",
			"repo_id": "9894888",
			"repo_name": "jeffjffang/demo2",
			"repo_url": "https://git.test.code.oa.com/jeffjffang/demo2",
			"branch": "refs/heads/dev",
			"branch_status": "0",
			"create_from": "",
			"operator": "jeffjffang",
			"created": "2019-10-11 16:18:00"	
		},
		{
			"id": "1000000755000000613",
			"workspace_id": "755",
			"type": "story",
			"object_id": "1000000755500695069",
			"repo_id": "9894888",
			"repo_name": "jeffjffang/demo2",
			"repo_url": "https://git.test.code.oa.com/jeffjffang/demo2",
			"branch": "refs/heads/TAPDBugID-007117718",
			"branch_status": "0",
			"create_from": "",
			"operator": "jeffjffang",
			"created": "2019-10-11 16:19:05"
		}]
	},
	"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
上次更新: 2025-04-17 19:58:41