CODING OPEN API
基础路径
API BASE URL
- https://{your-team}.coding.net
CODING 提供了丰富的 API 接口,注册应用即可使用,无需审核,支持两种认证方式:OAuth 2.0 协议、个人访问令牌。
OAuth 认证
创建 CODING 应用
- 点击【个人设置】->【开放生态】->【创建应用】,填写信息。「回调地址」可填写为
http://127.0.0.1
,便于本地开发。
- 创建完成会获得 Client ID 和 Client Secret。
用户授权
浏览器访问以下链接,进入到授权登录页面:
GET https://{your-team}.coding.net/oauth_authorize.html
参数说明:
- your-team:团队域名前缀;
- client_id:应用详情页的 Client ID;
- redirect_uri:应用详情页填写的回调地址;
- response_type:返回类型,固定为 code;
- scope:授权范围,以逗号分隔,包括:
scope 名称 | 授权 | 说明 |
---|---|---|
user | 读 | 获取用户信息(名称、头像等 ) |
user:email | 读 | 读取用户的 email |
notification | 读/写 | 读取用户通知信息 |
project | 读 | 授权项目信息、项目列表,仓库信息,公钥列表、成员 |
project:api_doc | 发布 | 授权发布 API 文档 |
project:artifacts | 读/写 | 授权推送、拉取制品库 |
project:depot | 读/写 | 完整的仓库控制权限 |
project:file | 读/写 | 授权读取与操作文件 |
project:issue | 读/写 | 授权读取与操作项目协同模块 |
project:key | 读/写 | 授权读取与操作部署公钥和个人公钥 |
project:members | 读/写 | 授权项目管理者读取与操作成员 |
project:notice | 读/写 | 授权发布、删除、查询项目公告接口 |
登录授权后,浏览器将带着授权码(code)参数跳转到回调地址,如:
http://127.0.0.1:9002/api/oauth/callback?code=7923f69445119400c12e1a70b027a97a
获取 access_token
获取授权码(code)后,开发者的后端程序向 CODING 发送请求,获取 access_token。
请求链接:
POST https://{your-team}.coding.net/api/oauth/access_token
参数说明:
- your-team:团队域名前缀;
- client_id:应用详情页的 Client ID;
- client_secret:应用详情页的 Client Secret;
- code:上一步获取的授权码;
- grant_type:授权类型,固定为 authorization_code;
返回值:
{
"access_token": "8883405e6c14856a1e2b3c4e2d2f2666",
"refresh_token": "6663211fda1a41f5a1c1fa320d819aaa",
"team": "anywhere",
"expires_in": "780260",
"token_type":"bearer"
}
获取当前用户信息
请求链接:
GET https://{your-team}.coding.net/api/me
参数说明:
- access_token:上一步获取的 access_token;
请求示例:
curl https://codes-farm.coding.net/api/me?access_token=at58a21646f43699196c42a30d77at
返回值:
{
"avatar": "https://coding-net-production-static-ci.codehub.cn/2cb665a3-bebc-4b09-aa00-2b6df3e33edc.jpg",
"created_at": 1572178118000,
"global_key": "KMRnIKgzbV",
"name": "sink",
"name_pinyin": "sink",
"updated_at": 1598411867000,
"path": "/u/KMRnIKgzbV",
"id": 183478,
"team": "anywhere",
"email_validation": 1
}
个人令牌认证
获取个人令牌
点击右上角的【个人设置】>【访问令牌】>【新建令牌】,勾选相关权限后会生成「个人访问令牌」。若刷新页面令牌会消失,需输入账号密码后重新生成。
获取当前用户信息
请求链接:
GET https://{your-team}.coding.net/api/me
header:
Authorization: token {访问令牌}
请求示例:
curl -H 'Authorization: token t0544956253e82fa2ba780a5248750t' \
https://codes-farm.coding.net/api/me
新版接口认证方式
新版接口不再使用 RESTFul,而使用 POST 和统一链接。
统一链接:https://e.coding.net/open-api
Accept: application/json
OAuth2:Authorization: Bearer at58a21646f43699196c42a30d77at
个人令牌:
Authorization: token f5d7a1e1dabb116335b648c5fd9a1c868e4f31d3
输入示例:
{
"Action":"DescribeOneProject",
"ProjectId":2
}
输出示例:
{
"Response": {
"Project": {
"Name": "coding-demo",
"Id": 2,
},
"RequestId": "ae8e2d5f-569b-443e-8c61-440ea3a7562a"
}
}
创建项目
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:CreateCodingProject |
Name | 是 | String | 项目标识 |
DisplayName | 是 | String | 项目名称 |
GitReadmeEnabled | 是 | Boolean | 启用 README.md 文件初始化项目 true|false |
VcsType | 是 | String | git|svn|hg |
CreateSvnLayout | 是 | Boolean | 是否创建 SVN 仓库推荐布局 默认 false |
Shared | 是 | Integer | 0: 不公开 1:公开源代码 |
ProjectTemplate | 是 | String | 项目模版 CODE_HOST 代码托管项目, PROJECT_MANAGE 项目管理项目, DEV_OPS DevOps 项目, DEMO_BEGIN 范例项目 |
Description | 否 | String | 项目描述 |
Icon | 否 | String | 项目图标 |
GitIgnore | 否 | String | git ignore 文件类型 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
ProjectId | Integer | 项目 Id |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
Example 1
成功示例
1{
2 "Action": "CreateCodingProject",
3 "Name": "project",
4 "DisplayName": "project",
5 "Description": "project",
6 "GitReadmeEnabled": true,
7 "VcsType": "git",
8 "CreateSvnLayout": false,
9 "Shared": 1,
10 "ProjectTemplate": "DEV_OPS"
11}
成功示例
1{
2 "Response": {
3 "RequestId": "ae8e2d5f-569b-443e-8c61-440ea3a7562a",
4 "ProjectId": 1
5 }
6}
编辑项目
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:ModifyProject |
ProjectId | 是 | Integer | 项目 id |
Name | 是 | String | 项目标识 |
DisplayName | 是 | String | 项目名称 |
Description | 否 | String | 项目描述 |
StartDate | 否 | String | 开始时间 |
EndDate | 否 | String | 结束时间 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
Example 1
成功示例
1{
2 "Action": "ModifyProject",
3 "ProjectId": 1,
4 "Name": "project",
5 "DisplayName": "project",
6 "Description": "project",
7 "StartDate": "2020-01-01",
8 "EndDate": "2020-01-02"
9}
成功示例
1{
2 "Response": {
3 "RequestId": "ae8e2d5f-569b-443e-8c61-440ea3a7562a"
4 }
5}
删除项目
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DeleteOneProject |
ProjectId | 是 | Integer | 项目 Id |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
Example 1
成功示例
1{
2 "Action": "DescribeOneProject",
3 "ProjectId": 2
4}
成功示例
1{
2 "Response": {
3 "RequestId": "ae8e2d5f-569b-443e-8c61-440ea3a7562a"
4 }
5}
查询项目
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DescribeOneProject |
ProjectId | 是 | Integer | 项目 Id |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Project | Project | 项目信息 注意:此字段可能返回 null,表示取不到有效值。 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
项目信息
名称 | 类型 | 描述 |
---|---|---|
Id | Integer | 项目 ID |
CreatedAt | Integer | 创建时间 注意:此字段可能返回 null,表示取不到有效值。 |
UpdatedAt | Integer | 更新时间 注意:此字段可能返回 null,表示取不到有效值。 |
Status | Integer | 状态 注意:此字段可能返回 null,表示取不到有效值。 |
Type | Integer | 类型 注意:此字段可能返回 null,表示取不到有效值。 |
Name | String | 名称 注意:此字段可能返回 null,表示取不到有效值。 |
DisplayName | String | 显示名称 注意:此字段可能返回 null,表示取不到有效值。 |
Description | String | 描述 注意:此字段可能返回 null,表示取不到有效值。 |
Icon | String | 图标 注意:此字段可能返回 null,表示取不到有效值。 |
TeamId | Integer | 团队 ID 注意:此字段可能返回 null,表示取不到有效值。 |
IsDemo | Boolean | 是否为模板项目 注意:此字段可能返回 null,表示取不到有效值。 |
MaxMember | Integer | 最大团员数 注意:此字段可能返回 null,表示取不到有效值。 |
UserOwnerId | Integer | 个人所有者 ID 注意:此字段可能返回 null,表示取不到有效值。 |
Archived | Boolean | 是否压缩 注意:此字段可能返回 null,表示取不到有效值。 |
StartDate | Integer | 项目开始时间 注意:此字段可能返回 null,表示取不到有效值。 |
TeamOwnerId | Integer | 团队所有者 ID 注意:此字段可能返回 null,表示取不到有效值。 |
EndDate | Integer | 项目结束时间 注意:此字段可能返回 null,表示取不到有效值。 |
Example 1
成功示例
1{
2 "Action": "DescribeOneProject",
3 "ProjectId": 2
4}
成功示例
1{
2 "Response": {
3 "Project": {
4 "Name": "coding-demo",
5 "Id": 2,
6 "Type": 2,
7 "DisplayName": "示例项目",
8 "Icon": "https://codehub.cn/7971.png",
9 "Description": "CODING 示例项目",
10 "CreatedAt": 1572933083682,
11 "MaxMember": 0,
12 "TeamId": 12,
13 "UserOwnerId": 0,
14 "IsDemo": true,
15 "Archived": false,
16 "StartDate": 0,
17 "UpdatedAt": 1572933083682,
18 "TeamOwnerId": 0,
19 "EndDate": 0,
20 "Status": 1
21 },
22 "RequestId": "ae8e2d5f-569b-443e-8c61-440ea3a7562a"
23 }
24}
查询成员所在项目列表
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DescribeUserProjects |
userId | 是 | Integer | 成员 Id |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
ProjectList | Array of Project | 项目列表信息 注意:此字段可能返回 null,表示取不到有效值。 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
参数信息
名称 | 类型 | 描述 |
---|---|---|
Id | Integer | 项目 ID |
CreatedAt | Integer | 创建时间 注意:此字段可能返回 null,表示取不到有效值。 |
UpdatedAt | Integer | 更新时间 注意:此字段可能返回 null,表示取不到有效值。 |
Status | Integer | 状态 注意:此字段可能返回 null,表示取不到有效值。 |
Type | Integer | 类型 注意:此字段可能返回 null,表示取不到有效值。 |
Name | String | 名称 注意:此字段可能返回 null,表示取不到有效值。 |
DisplayName | String | 显示名称 注意:此字段可能返回 null,表示取不到有效值。 |
Description | String | 描述 注意:此字段可能返回 null,表示取不到有效值。 |
Icon | String | 图标 注意:此字段可能返回 null,表示取不到有效值。 |
TeamId | Integer | 团队 ID 注意:此字段可能返回 null,表示取不到有效值。 |
IsDemo | Boolean | 是否为模板项目 注意:此字段可能返回 null,表示取不到有效值。 |
MaxMember | Integer | 最大团员数 注意:此字段可能返回 null,表示取不到有效值。 |
UserOwnerId | Integer | 个人所有者 ID 注意:此字段可能返回 null,表示取不到有效值。 |
Archived | Boolean | 是否压缩 注意:此字段可能返回 null,表示取不到有效值。 |
StartDate | Integer | 项目开始时间 注意:此字段可能返回 null,表示取不到有效值。 |
TeamOwnerId | Integer | 团队所有者 ID 注意:此字段可能返回 null,表示取不到有效值。 |
EndDate | Integer | 项目结束时间 注意:此字段可能返回 null,表示取不到有效值。 |
Example 1
成功示例
1{
2 "Action": "DescribeUserProjects",
3 "userId": 2
4}
成功示例
1{
2 "Response": {
3 "ProjectList": [
4 {
5 "Name": "coding-demo",
6 "Id": 2,
7 "Type": 2,
8 "DisplayName": "示例项目",
9 "Icon": "https://dn-coding-net-production-pp.codehub.cn/79a8bcc4-d9cc-4061-940d-5b3bb31bf571.png",
10 "Description": "CODING 示例项目",
11 "CreatedAt": 1572933083682,
12 "MaxMember": 0,
13 "TeamId": 12,
14 "UserOwnerId": 0,
15 "IsDemo": true,
16 "Archived": false,
17 "StartDate": 0,
18 "UpdatedAt": 1572933083682,
19 "TeamOwnerId": 0,
20 "EndDate": 0,
21 "Status": 1
22 }
23 ],
24 "RequestId": "ae8e2d5f-569b-443e-8c61-440ea3a7562a"
25 }
26}
获取用户个人信息
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DescribeCodingCurrentUser |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
User | User 类型 | 用户个人信息 |
参数说明
名称 | 类型 | 描述 |
---|---|---|
Id | Integer | 用户 ID |
Status | Integer | 状态(新用户/已激活) 注意:此字段可能返回 null,表示取不到有效值。 |
String | 邮箱 注意:此字段可能返回 null,表示取不到有效值。 | |
GlobalKey | String | 用户唯一标志 注意:此字段可能返回 null,表示取不到有效值。 |
Avatar | String | 头像地址 注意:此字段可能返回 null,表示取不到有效值。 |
Name | String | 姓名 注意:此字段可能返回 null,表示取不到有效值。 |
NamePinYin | String | 姓名拼音 注意:此字段可能返回 null,表示取不到有效值。 |
Phone | String | 联系电话 注意:此字段可能返回 null,表示取不到有效值。 |
PhoneValidation | Integer | 手机是否已验证 注意:此字段可能返回 null,表示取不到有效值。 |
EmailValidation | Integer | 邮箱是否已验证 注意:此字段可能返回 null,表示取不到有效值。 |
PhoneRegionCode | String | 手机号地区 注意:此字段可能返回 null,表示取不到有效值。 |
TeamId | Integer | 团队 ID 注意:此字段可能返回 null,表示取不到有效值。 |
Example 1
成功示例
1{
2 "Action": "DescribeCodingCurrentUser"
3}
成功示例
1{
2 "Response": {
3 "RequestId": "367bdaa8-e4c7-a070-ecf6-00fea8e6fab9",
4 "User": {
5 "Id": 150258,
6 "Status": 1,
7 "Email": "test@coding.net",
8 "GlobalKey": "EHRIORBbfF",
9 "Avatar": "https://coding-net-production-static-ci.codehub.cn/WM-TEXT-AVATAR-nfutKljCRlKcSLDTOmrv.jpg",
10 "Name": "张三",
11 "NamePinYin": "zhangsan",
12 "Phone": "13800138000",
13 "PhoneValidation": 1,
14 "EmailValidation": 1,
15 "PhoneRegionCode": "+86",
16 "TeamId": 102882
17 }
18 }
19}
配置项目成员权限
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:ModifyProjectPermission。 |
RoleId | 是 | Integer | 权限 ID |
UserGK | 是 | String | user gk |
ProjectId | 是 | Integer | 项目 Id |
ActionFlag | 是 | Boolean | 权限创建、删除 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
Example 1
成功示例
1{
2 "Action": "ModifyProjectPermission",
3 "RoleId": 120,
4 "UserGK": "TDqyhVeWYN",
5 "ProjectId": 2,
6 "ActionFlag": false
7}
成功示例
1{
2 "Response": {
3 "RequestId": "ae8e2d5f-569b-443e-8c61-440ea3a7562a"
4 }
5}
查询需求关联事项列表
输入参数
以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见公共请求参数。
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DescribeRequirementDefectRelation。 |
ProjectName | 是 | String | 项目名称 |
RequirementCode | 是 | Integer | 需求 Code |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Issues | Array of IssueSimpleData | 缺陷列表 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
Example 1
成功示例
1{
2 "ProjectName": "project-demo",
3 "RequirementCode": 1
4}
成功示例
1{
2 "Response": {
3 "Issues": [
4 {
5 "Code": 27,
6 "Type": "REQUIREMENT",
7 "Name": "xxx",
8 "IssueStatusId": 4,
9 "IssueStatusName": "未开始",
10 "IssueStatusType": "TODO",
11 "Priority": "3",
12 "Assignee": {
13 "Status": 1,
14 "Name": "xxx",
15 "Id": 1,
16 "Phone": "111",
17 "TeamId": 1,
18 "GlobalKey": "coding",
19 "Avatar": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
20 "Email": "coding.com",
21 "TeamGlobalKey": "coding"
22 }
23 },
24 {
25 "Code": 25,
26 "Type": "REQUIREMENT",
27 "Name": "xxx",
28 "IssueStatusId": 4,
29 "IssueStatusName": "未开始",
30 "IssueStatusType": "TODO",
31 "Priority": "3",
32 "Assignee": {
33 "Status": 1,
34 "Name": "xxx",
35 "Id": 1,
36 "Phone": "111",
37 "TeamId": 1,
38 "GlobalKey": "coding",
39 "Avatar": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
40 "Email": "coding.com",
41 "TeamGlobalKey": "coding"
42 }
43 }
44 ],
45 "RequestId": "1"
46 }
47}
修改缺陷所属的需求
输入参数
以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见公共请求参数。
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:ModifyDefectRelatedRequirement。 |
ProjectName | 是 | String | 项目名称 |
DefectCode | 是 | Integer | 缺陷 Code |
RequirementCode | 是 | Integer | 需求 Code |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
Example 1
成功示例
1{
2 "ProjectName": "project-demo",
3 "DefectCode": 2,
4 "RequirementCode": 3
5}
成功示例
1{
2 "Response": {
3 "RequestId": "1"
4 }
5}
需求关联缺陷
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:CreateRequirementDefectRelation。 |
ProjectName | 是 | String | 项目名称 |
RequirementCode | 是 | Integer | 需求 Code |
DefectCode | 是 | Integer | 缺陷 Code |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
Example 1
成功示例
1{
2 "ProjectName": "project-demo",
3 "RequirementCode": 1,
4 "DefectCode": 2
5}
成功示例
1{
2 "Response": {
3 "RequestId": "1"
4 }
5}
创建事项
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:CreateIssue |
ProjectName | 是 | String | 项目名称 |
Type | 是 | String | 事项类型 DEFECT - 缺陷 REQUIREMENT - 需求 MISSION - 任务 EPIC - 史诗 SUB_TASK - 子任务 |
ParentCode | 否 | Integer | 所属事项 Code,Type 为 SUB_TASK 时需指定 |
Name | 是 | String | 事项名称 |
StatusId | 否 | Integer | 事项状态 Id |
AssigneeId | 否 | Integer | 指派人 Id |
Description | 否 | String | 描述 |
DueDate | 否 | String | 截止日期 |
StartDate | 否 | String | 开始日期 |
WorkingHours | 否 | Double | 工时(小时) |
ProjectModuleId | 否 | Integer | 项目模块 Id |
WatcherIds | 否 | Array of Integer | 事项关注人 Id 列表 |
DefectTypeId | 否 | Integer | 项目缺陷类型 Id |
RequirementTypeId | 否 | Integer | 项目需求类型 Id |
Priority | 是 | String | 紧急程度 "0" - 低 "1" - 中 "2" - 高 "3" - 紧急 |
IterationCode | 否 | Integer | 迭代 Code,Type 为 EPIC 或 SUB_TASK 时,忽略该值 |
EpicCode | 否 | Integer | 史诗 Code,Type 为 EPIC 或 SUB_TASK 时,不传该值 |
StoryPoint | 否 | String | 故事点,例如:0.5、1 |
LabelIds | 否 | Array of Integer | 标签 Id 列表 |
FileIds | 否 | Array of Integer | 文件 Id 列表 |
TargetSortCode | 否 | Integer | 排序目标位置的事项 code 可不填,排在底位 |
ThirdLinks | 否 | Array of CreateThirdLinkForm | 第三方链接列表 |
CustomFieldValues | 否 | Array of IssueCustomFieldForm | 自定义属性值列表 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Issue | IssueDetail | 事项信息 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
名称 | 必选 | 类型 | 描述 |
---|---|---|---|
ThirdType | 是 | String | 第三方链接类型,MODAO - 墨刀 |
Title | 是 | String | 链接标题 |
Link | 是 | String | 链接地址 |
属性的 Id 和取值需先通过查询属性设置获取。
名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Id | 是 | Integer | 事项自定义属性 Id |
Content | 是 | String | 自定义属性值 多选值使用逗号 “,” 分隔 |
Example 1
成功示例
1{
2 "Action": "CreateIssue",
3 "ProjectName": "demo-project",
4 "Type": "REQUIREMENT",
5 "Name": "一个需求",
6 "Priority": "0",
7 "CustomFieldValues": [
8 {
9 "Id": 34929409,
10 "Content": "1"
11 }
12 ]
13}
成功示例
1{
2 "Response": {
3 "RequestId": "c2e8cdce-9d9f-be99-e209-3dae07b690ac",
4 "Issue": {
5 "ParentType": "REQUIREMENT",
6 "Code": 27,
7 "Type": "REQUIREMENT",
8 "Name": "test-20200826-1",
9 "Description": "",
10 "IterationId": 0,
11 "IssueStatusId": 4,
12 "IssueStatusName": "未开始",
13 "IssueStatusType": "TODO",
14 "Priority": "0",
15 "Assignee": {
16 "Id": 0,
17 "Status": 0,
18 "GlobalKey": "",
19 "Avatar": "",
20 "Media": "",
21 "Name": "",
22 "Email": ""
23 },
24 "StartDate": 0,
25 "DueDate": 0,
26 "WorkingHours": 0,
27 "Creator": {
28 "Id": 1,
29 "Status": 2,
30 "GlobalKey": "coding",
31 "Avatar": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
32 "Media": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
33 "Name": "coding",
34 "Email": ""
35 },
36 "StoryPoint": "",
37 "CreatedAt": 1598843625826,
38 "UpdatedAt": 1598843625826,
39 "CompletedAt": 0,
40 "ProjectModule": {
41 "Id": 0,
42 "Name": ""
43 },
44 "Watchers": [
45 {
46 "Id": 1,
47 "Status": 2,
48 "GlobalKey": "coding",
49 "Avatar": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
50 "Media": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
51 "Name": "coding",
52 "Email": ""
53 }
54 ],
55 "Labels": [],
56 "Files": [],
57 "RequirementType": {
58 "Id": 0,
59 "Name": ""
60 },
61 "DefectType": {
62 "Id": 0,
63 "Name": "",
64 "IconUrl": ""
65 },
66 "CustomFields": [],
67 "ThirdLinks": [],
68 "SubTasks": [],
69 "Parent": {
70 "Code": 0,
71 "Type": "",
72 "Name": "",
73 "IssueStatusId": 0,
74 "IssueStatusName": "",
75 "Priority": "",
76 "Assignee": {
77 "Id": 0,
78 "Status": 0,
79 "GlobalKey": "",
80 "Avatar": "",
81 "Media": "",
82 "Name": "",
83 "Email": ""
84 }
85 },
86 "Epic": {
87 "Code": 0,
88 "Type": "",
89 "Name": "",
90 "IssueStatusId": 0,
91 "IssueStatusName": "",
92 "Priority": "",
93 "Assignee": {
94 "Id": 0,
95 "Status": 0,
96 "GlobalKey": "",
97 "Avatar": "",
98 "Media": "",
99 "Name": "",
100 "Email": ""
101 }
102 }
103 }
104 }
105}
删除事项
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DeleteIssue |
ProjectName | 是 | String | 项目名称 |
IssueCode | 是 | Integer | 事项 Code |
IssueType | 否 | String | 事项类型,可不填 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
Example 1
成功示例
1{
2 "Action": "DeleteIssue",
3 "ProjectName": "demo-project",
4 "IssueCode": 3
5}
成功示例
1{
2 "Response": {
3 "RequestId": "135f80f0-0577-6421-293e-ec231ff3b337"
4 }
5}
查询事项附件的下载地址
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DescribeIssueFileUrl |
ProjectName | 是 | String | 项目名称 |
FileId | 是 | Integer | 文件 Id |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Url | String | 文件下载地址 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
Example 1
成功示例
1{
2 "Action": "DescribeIssueFileUrl",
3 "ProjectName": "project-demo",
4 "FileId": 7
5}
成功示例
1{
2 "Response": {
3 "RequestId": "3cdcc77c-f1a3-1695-fafe-6bb4fc71b647",
4 "Url": "http://coding-net-test-self-1257242599.cos.ap-shanghai.myqcloud.com/b6357cc0-e357-11ea-af4e-4177fbfe7a25.txt?sign=q-sign-algorithm=sha1&q-ak=AKIDUnFWaPTLQccQyIsuIdCdq04B8xd6iOK4&q-sign-time=1599013747;1599017347&q-key-time=1599013747;1599017347&q-header-list=&q-url-param-list=response-content-disposition;response-expires&q-signature=4aa5d8f991c0388561f0c43e0f15059e91ccede7&response-content-disposition=attachment;filename=testfile-20200821104044.txt&response-expires=Fri, 04 Sep 2020 14:29:07 GMT"
5 }
6}
查询筛选器列表
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DescribeIssueFilterList |
ProjectName | 是 | String | 项目名称 |
IssueType | 是 | String | 事项类型 ALL - 全部事项 DEFECT - 缺陷 REQUIREMENT - 需求 MISSION - 任务 EPIC - 史诗 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Data | IssueFilterListData | 过滤器列表,包含系统过滤器和自定义过滤器。 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
IssueFilterListData
参数名称 | 类型 | 描述 |
---|---|---|
SystemFilterList | Array of IssueFilter | 系统过滤器列表 |
SystemFilterList | Array of IssueFilter | 自定义过滤器列表 |
IssueFilter
参数名称 | 类型 | 描述 |
---|---|---|
Id | Integer | 过滤器 ID |
IssueType | String | 事项类型 |
CreatorId | Integer | 创建人 ID |
Name | String | 名称 |
IsSystem | Boolean | 是否是团队筛选器 |
SharedTeam | Boolean | 是否是系统自带 |
IsDefault | Boolean | 默认筛选器 |
Content | String | 筛选组合,JSON 字符串 例如:{"filterIssueType":"ALL","sort":{"key":"PRIORITY","value":"DESC"},"conditions": [{"value":["TODO","PROCESSING"],"key":"STATUS_TYPE","fixed":true,"filterIssueType":"ALL","projectId":1},{"value":[],"key":"ASSIGNEE","fixed":true,"constValue":["UNSPECIFIC"] ,"filterIssueType":"ALL","projectId":1} |
CreatedAt | Long | 创建时间 |
UpdatedAt | Long | 修改时间 |
Example 1
成功示例
1{
2 "Action": "DescribeIssueFilterList",
3 "ProjectName": "demo-project",
4 "IssueType": "REQUIREMENT"
5}
成功示例
1{
2 "Response": {
3 "RequestId": "146e1c15-b712-a7b6-851b-16267a079fad",
4 "Data": {
5 "SystemFilterList": [
6 {
7 "Id": 1,
8 "IssueType": "REQUIREMENT",
9 "CreatorId": 1,
10 "Name": "我未完成的",
11 "IsSystem": true,
12 "SharedTeam": false,
13 "IsDefault": false,
14 "Content": "{\"FilterIssueType\":\"REQUIREMENT\",\"Sort\":{\"Key\":\"PRIORITY\",\"Value\":\"DESC\"},\"Conditions\":[{\"Key\":\"STATUS_TYPE\",\"Fixed\":true,\"ConstValue\":null,\"FilterIssueType\":\"REQUIREMENT\",\"ProjectId\":1,\"ProjectIds\":null,\"Value\":[\"TODO\",\"PROCESSING\"],\"TeamView\":false},{\"Key\":\"ASSIGNEE\",\"Fixed\":true,\"ConstValue\":null,\"FilterIssueType\":\"REQUIREMENT\",\"ProjectId\":1,\"ProjectIds\":null,\"Value\":[1],\"ValueChanged\":null,\"ValidInfo\":null,\"Status\":null,\"TeamView\":false}]}",
15 "CreatedAt": 1597908832000,
16 "UpdatedAt": 1597908832000
17 },
18 {
19 "Id": 2,
20 "IssueType": "REQUIREMENT",
21 "CreatorId": 1,
22 "Name": "分配给我的",
23 "IsSystem": true,
24 "SharedTeam": false,
25 "IsDefault": false,
26 "Content": "{\"FilterIssueType\":\"REQUIREMENT\",\"Sort\":{\"Key\":\"PRIORITY\",\"Value\":\"DESC\"},\"Conditions\":[{\"Key\":\"ASSIGNEE\",\"Fixed\":true,\"ConstValue\":null,\"FilterIssueType\":\"REQUIREMENT\",\"ProjectId\":1,\"ProjectIds\":null,\"Value\":[1],\"ValueChanged\":null,\"ValidInfo\":null,\"Status\":null,\"TeamView\":false}]}",
27 "CreatedAt": 1597908833000,
28 "UpdatedAt": 1597908833000
29 },
30 {
31 "Id": 3,
32 "IssueType": "REQUIREMENT",
33 "CreatorId": 1,
34 "Name": "我创建的",
35 "IsSystem": true,
36 "SharedTeam": false,
37 "IsDefault": false,
38 "Content": "{\"FilterIssueType\":\"REQUIREMENT\",\"Sort\":{\"Key\":\"PRIORITY\",\"Value\":\"DESC\"},\"Conditions\":[{\"Key\":\"CREATOR\",\"Fixed\":false,\"ConstValue\":null,\"FilterIssueType\":\"REQUIREMENT\",\"ProjectId\":1,\"ProjectIds\":null,\"Value\":[1],\"ValueChanged\":false,\"ValidInfo\":null,\"Status\":null,\"TeamView\":false}]}",
39 "CreatedAt": 1597908833000,
40 "UpdatedAt": 1597908833000
41 },
42 {
43 "Id": 4,
44 "IssueType": "REQUIREMENT",
45 "CreatorId": 1,
46 "Name": "我关注的",
47 "IsSystem": true,
48 "SharedTeam": false,
49 "IsDefault": false,
50 "Content": "{\"FilterIssueType\":\"REQUIREMENT\",\"Sort\":{\"Key\":\"PRIORITY\",\"Value\":\"DESC\"},\"Conditions\":[{\"Key\":\"WATCHER\",\"Fixed\":false,\"ConstValue\":null,\"FilterIssueType\":\"REQUIREMENT\",\"ProjectId\":1,\"ProjectIds\":null,\"Value\":[1],\"ValueChanged\":null,\"ValidInfo\":null,\"Status\":null,\"TeamView\":false}]}",
51 "CreatedAt": 1597908833000,
52 "UpdatedAt": 1597908833000
53 },
54 {
55 "Id": 5,
56 "IssueType": "REQUIREMENT",
57 "CreatorId": 1,
58 "Name": "全部打开的",
59 "IsSystem": true,
60 "SharedTeam": false,
61 "IsDefault": true,
62 "Content": "{\"FilterIssueType\":\"REQUIREMENT\",\"Sort\":{\"Key\":\"PRIORITY\",\"Value\":\"DESC\"},\"Conditions\":[{\"Key\":\"STATUS_TYPE\",\"Fixed\":true,\"ConstValue\":null,\"FilterIssueType\":\"REQUIREMENT\",\"ProjectId\":1,\"ProjectIds\":null,\"Value\":[\"TODO\",\"PROCESSING\"],\"TeamView\":false}]}",
63 "CreatedAt": 1597908833000,
64 "UpdatedAt": 1597908833000
65 },
66 {
67 "Id": 6,
68 "IssueType": "REQUIREMENT",
69 "CreatorId": 1,
70 "Name": "全部",
71 "IsSystem": true,
72 "SharedTeam": false,
73 "IsDefault": false,
74 "Content": "{\"FilterIssueType\":\"REQUIREMENT\",\"Sort\":{\"Key\":\"CREATED_AT\",\"Value\":\"DESC\"},\"Conditions\":[]}",
75 "CreatedAt": 1597908833000,
76 "UpdatedAt": 1597908833000
77 }
78 ],
79 "CustomFilterList": []
80 }
81 }
82}
查询事项列表
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DescribeIssueList |
ProjectName | 是 | String | 项目名称 |
IssueType | 是 | Integer | 事项类型 ALL - 全部事项 DEFECT - 缺陷 REQUIREMENT - 需求 MISSION - 任务 EPIC - 史诗 |
Offset | 是 | Integer | 偏移量 |
Limit | 是 | Integer | 限制数目 |
Conditions | 否 | Array of IssueCondition | 筛选条件列表 |
SortKey | 否 | String | 排序字段,默认:CODE |
SortValue | 否 | String | 排序方式 DESC - 倒序(默认值) ASC - 正序 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
IssueList | Array of IssueListData | 事项列表。 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
IssueCondition
参数名称 | 类型 | 描述 |
---|---|---|
Key | String | 字段名,例如:STATUS_TYPE。 自定义字段 Key 为 "CUSTOM",同时需指定 CustomFieldId |
Value | String | 筛选值,多选值用逗号隔开。 日期格式: 2020-08-01,日期时间格式: 2020-08-01 12:00:00 整数、小数、日期、日期时间类型的字段值应为一个范围,前后闭区间,范围开始值与结束值之间使用"_"连接,例如:"0.1_5.0"、"2020-08-01_2020-08-31"。 |
ConstValue | String | 常量值 "UNSPECIFIC" 表示未指定,例如:处理人、需求类型、标签等字段,使用此值来筛选未指定处理人、需求类型或标签的事项。 |
CustomFieldId | Integer | 自定义字段 Id,Key 为 "CUSTOM" 时需设置该值,常规字段无需设置。 |
IssueListData
参数名称 | 类型 | 描述 |
---|---|---|
ParentType | String | 父事项类型 |
Code | Integer | 事项 Code |
Type | String | 事项类型 |
Name | String | 名称 |
Description | String | 描述 |
IterationId | Integer | 迭代 Id |
IssueStatusId | Integer | 迭代状态 Id |
IssueStatusName | String | 迭代状态名称 |
IssueStatusType | String | 迭代状态类型,例如:TODO |
Priority | String | 优先级 "0" - 低 "1" - 中 "2" - 高 "3" - 紧急 "" - 未指定 |
AssigneeId | Integer | 处理人 Id |
StartDate | Long | 开始日期时间戳 |
DueDate | Long | 截止日期时间戳 |
WorkingHours | Double | 工时(小时) |
CreatorId | Integer | 创建人 Id |
StoryPoint | String | 故事点,例如:"0.5"、"0" 空字符串 "" 表示未指定。 |
CreatedAt | Long | 创建时间 |
UpdatedAt | Long | 修改时间 |
CompletedAt | Long | 完成时间 |
Example 1
成功示例
1{
2 "Action": "DescribeIssueList",
3 "ProjectName": "demo-project",
4 "IssueType": "ALL",
5 "Offset": 0,
6 "Limit": 10
7}
成功示例
1{
2 "Response": {
3 "RequestId": "35c5b423-d311-d27f-f48c-a2ddf8b1cc59",
4 "IssueList": [
5 {
6 "ParentType": "REQUIREMENT",
7 "Code": 27,
8 "Type": "REQUIREMENT",
9 "Name": "test-20200826-1",
10 "Description": "",
11 "IterationId": 0,
12 "IssueStatusId": 4,
13 "IssueStatusName": "未开始",
14 "IssueStatusType": "TODO",
15 "Priority": "3",
16 "AssigneeId": 0,
17 "StartDate": 0,
18 "DueDate": 0,
19 "WorkingHours": 0,
20 "CreatorId": 1,
21 "StoryPoint": "0.5",
22 "CreatedAt": 1598843625000,
23 "UpdatedAt": 1598922564000,
24 "CompletedAt": 0
25 },
26 {
27 "ParentType": "REQUIREMENT",
28 "Code": 25,
29 "Type": "REQUIREMENT",
30 "Name": "test-20200826-1",
31 "Description": "",
32 "IterationId": 0,
33 "IssueStatusId": 4,
34 "IssueStatusName": "未开始",
35 "IssueStatusType": "TODO",
36 "Priority": "3",
37 "AssigneeId": 0,
38 "StartDate": 0,
39 "DueDate": 0,
40 "WorkingHours": 0,
41 "CreatorId": 1,
42 "StoryPoint": "2.0",
43 "CreatedAt": 1598517062000,
44 "UpdatedAt": 1598851550000,
45 "CompletedAt": 0
46 },
47 {
48 "ParentType": "REQUIREMENT",
49 "Code": 24,
50 "Type": "REQUIREMENT",
51 "Name": "test-20200826-1",
52 "Description": "",
53 "IterationId": 0,
54 "IssueStatusId": 4,
55 "IssueStatusName": "未开始",
56 "IssueStatusType": "TODO",
57 "Priority": "3",
58 "AssigneeId": 0,
59 "StartDate": 0,
60 "DueDate": 0,
61 "WorkingHours": 0,
62 "CreatorId": 1,
63 "StoryPoint": "",
64 "CreatedAt": 1598511946000,
65 "UpdatedAt": 1598511946000,
66 "CompletedAt": 0
67 }
68 ]
69 }
70}
查询事项详情
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DescribeIssue |
ProjectName | 是 | String | 项目名称 |
IssueCode | 是 | Integer | 事项 Code |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Issue | IssueDetail | 事项信息。 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
IssueDetail
参数名称 | 类型 | 描述 |
---|---|---|
ParentType | String | 父事项类型 |
Code | Integer | 事项 Code |
Type | String | 事项类型 |
Name | String | 名称 |
Description | String | 描述 |
IterationId | Integer | 迭代 Id |
IssueStatusId | Integer | 迭代状态 Id |
IssueStatusName | String | 迭代状态名称 |
IssueStatusType | String | 迭代状态类型,例如:TODO |
Priority | String | 优先级 "0" - 低 "1" - 中 "2" - 高 "3" - 紧急 "" - 未指定 |
Assignee | UserSimple | 处理人,Assignee.Id 等于 0 时表示未指定。 |
StartDate | Long | 开始日期时间戳 |
DueDate | Long | 截止日期时间戳 |
WorkingHours | Double | 工时(小时) |
Creator | UserSimple | 创建人 |
StoryPoint | String | 故事点,例如:"0.5"、"0" 空字符串 "" 表示未指定。 |
CreatedAt | Long | 创建时间 |
UpdatedAt | Long | 修改时间 |
CompletedAt | Long | 完成时间 |
ProjectModule | ProjectModule | 项目模块,ProjectModule.Id 等于 0 时表示未指定。 |
Watchers | Array of UserSimple | 关注人 |
Labels | Array of Label | 标签列表 |
Files | Array of ProjectFile | 附件列表 |
RequirementType | 需求类型 | |
DefectType | DefectType | 缺陷类型 |
CustomFields | Array of CustomField | 自定义字段列表 |
ThirdLinks | Array of ThirdLink | 第三方链接列表 |
SubTasks | Array of SubTask | 子任务列表 |
Parent | IssueSimple | 父事项 |
Epic | Epic | 所属史诗 |
Iteration | IterationSimple | 所属迭代 |
UserSimple
参数名称 | 类型 | 描述 |
---|---|---|
Id | Integer | 用户 Id |
Status | Integer | 用户状态 |
Avatar | String | 头像地址 |
Name | String | 姓名 |
String | 邮箱 |
ProjectModule
参数名称 | 类型 | 描述 |
---|---|---|
Id | Integer | 用户 Id |
Name | String | 模块名称 |
Label
参数名称 | 类型 | 描述 |
---|---|---|
Id | Integer | 用户 Id |
Name | String | 名称 |
Color | String | 颜色 |
ProjectFile
参数名称 | 类型 | 描述 |
---|---|---|
FileId | Integer | 文件 Id |
Name | String | 文件名称 |
Type | Integer | 类型 0 - 文件夹 1 - 文本 2 - 图片 3 - 二进制 4 - SVG |
Size | Long | 大小(比特) |
Url | String | 下载地址 |
CustomField
参数名称 | 类型 | 描述 |
---|---|---|
Id | Integer | 自定义属性 Id |
ValueString | String | 自定义属性值,JSON 字符串 根据自定义属性的 ComponentType,返回不同类型的值,多选类型值为数组 另外:用户单选(SELECT_MEMBER_SINGLE)、用户多选(SELECT_MEMBER_MULTI)的自定义属性返回类型为 UserSimple 对象 |
ThirdLink
参数名称 | 类型 | 描述 |
---|---|---|
Id | Integer | 第三方链接 Id |
ThirdType | Integer | 第三方链接类型,MODAO - 墨刀 |
Link | String | 链接地址 |
Title | String | 名称 |
IssueSimple
参数名称 | 类型 | 描述 |
---|---|---|
Code | Integer | 事项 Code |
Type | String | 事项类型 |
Name | String | 名称 |
IssueStatusId | Integer | 迭代状态 Id |
IssueStatusName | String | 迭代状态名称 |
Priority | String | 优先级 |
Assignee | UserSimple | 处理人 |
Epic
参数名称 | 类型 | 描述 |
---|---|---|
Code | Integer | 事项 Code |
Type | String | 事项类型 |
Name | String | 名称 |
IssueStatusId | Integer | 迭代状态 Id |
IssueStatusName | String | 迭代状态名称 |
Priority | String | 优先级 |
Assignee | UserSimple | 处理人 |
SubTask
参数名称 | 类型 | 描述 |
---|---|---|
Code | Integer | 事项 Code |
Type | String | 事项类型 |
Name | String | 名称 |
IssueStatusId | Integer | 迭代状态 Id |
IssueStatusName | String | 迭代状态名称 |
Priority | String | 优先级 |
Assignee | UserSimple | 处理人 |
Example 1
成功示例
1{
2 "Action": "DescribeIssue",
3 "ProjectName": "demo-project",
4 "IssueCode": 1
5}
成功示例
1{
2 "Response": {
3 "RequestId": "d2e3c64c-99f8-1ef2-c148-36f7d6a81cfe",
4 "Issue": {
5 "ParentType": "REQUIREMENT",
6 "Code": 1,
7 "Type": "REQUIREMENT",
8 "Name": "测试需求1",
9 "Description": "# 标题1\n\n1. 列表1\n2. 列表2\n\n# 标题2\n\n1. 啦啦\n\n# 其他\n\n\n123",
10 "IterationId": 1,
11 "IssueStatusId": 4,
12 "IssueStatusName": "未开始",
13 "IssueStatusType": "TODO",
14 "Priority": "0",
15 "Assignee": {
16 "Id": 0,
17 "Status": 0,
18 "GlobalKey": "",
19 "Avatar": "",
20 "Media": "",
21 "Name": "",
22 "Email": ""
23 },
24 "StartDate": 0,
25 "DueDate": 1596643199000,
26 "WorkingHours": 0,
27 "Creator": {
28 "Id": 1,
29 "Status": 2,
30 "GlobalKey": "coding",
31 "Avatar": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
32 "Media": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
33 "Name": "coding",
34 "Email": ""
35 },
36 "StoryPoint": "",
37 "CreatedAt": 1597384413000,
38 "UpdatedAt": 1599035298000,
39 "CompletedAt": 0,
40 "ProjectModule": {
41 "Id": 0,
42 "Name": ""
43 },
44 "Watchers": [],
45 "Labels": [],
46 "Files": [],
47 "RequirementType": {
48 "Id": 0,
49 "Name": ""
50 },
51 "DefectType": {
52 "Id": 0,
53 "Name": "",
54 "IconUrl": ""
55 },
56 "CustomFields": [
57 {
58 "Id": 16,
59 "ValueString": "[{\"Id\":1,\"Status\":2,\"GlobalKey\":\"coding\",\"Avatar\":\"https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0\",\"Media\":\"https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0\",\"Name\":\"coding\",\"Email\":\"coding@coding.com\",\"Name_pinyin\":\"\"}]"
60 },
61 {
62 "Id": 18,
63 "ValueString": "2020-08-06 02:02:00"
64 },
65 {
66 "Id": 19,
67 "ValueString": "123"
68 }
69 ],
70 "ThirdLinks": [
71 {
72 "Id": 1,
73 "ThirdType": "MODAO",
74 "Link": "https://modao.cc/app/7fb28d9af13827fd009f401579cbdc3cef2a456a/embed/v2",
75 "Title": "墨刀 1"
76 }
77 ],
78 "SubTasks": [],
79 "Parent": {
80 "Code": 0,
81 "Type": "",
82 "Name": "",
83 "IssueStatusId": 0,
84 "IssueStatusName": "",
85 "Priority": "",
86 "Assignee": {
87 "Id": 0,
88 "Status": 0,
89 "GlobalKey": "",
90 "Avatar": "",
91 "Media": "",
92 "Name": "",
93 "Email": ""
94 }
95 },
96 "Epic": {
97 "Code": 0,
98 "Type": "",
99 "Name": "",
100 "IssueStatusId": 0,
101 "IssueStatusName": "",
102 "Priority": "",
103 "Assignee": {
104 "Id": 0,
105 "Status": 0,
106 "GlobalKey": "",
107 "Avatar": "",
108 "Media": "",
109 "Name": "",
110 "Email": ""
111 }
112 }
113 }
114 }
115}
查询属性设置
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DescribeProjectIssueFieldList |
ProjectName | 是 | String | 项目名称 |
IssueType | 是 | String | 事项类型 DEFECT - 缺陷 REQUIREMENT - 需求 MISSION - 任务 EPIC - 史诗 SUB_TASK - 子任务 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
ProjectIssueFieldList | Array of ProjectIssueField | 项目属性列表 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
ProjectIssueField
参数名称 | 类型 | 描述 |
---|---|---|
IssueFieldId | Integer | 关联属性 Id |
NeedDefault | String | 是否有默认值 |
ValueString | String | 默认值, JSON 字符串。例如:{"type":"VARIABLE","value":"CREATOR"} type:默认值类型,VARIABLE - 变量值(如创建者为 CREATOR) | CONSTANT - 常量值 value:默认值,根据 IssueField.ComponentType,可能为不同类型的值:数值、字符串、数组等 |
IssueType | String | 事项类型 |
Required | String | 是否必填 |
IssueField | IssueField | 关联属性 |
CreatedAt | Long | 创建时间 |
UpdatedAt | Long | 修改时间 |
IssueField
参数名称 | 类型 | 描述 |
---|---|---|
Id | Integer | 属性 Id |
Name | String | 名称 |
IconUrl | String | 图标地址 |
Type | String | 字段类型 |
ComponentType | String | 字段空间类型 TEXT_SINGLE_LINE - 单行文本 TEXT_MULTI_LINE - 多行文本 SELECT_SINGLE - 单选列表 SELECT_MULTI - 多选列表 RADIO - 单选框 CHECKBOX - 多选框 SELECT_MEMBER_SINGLE - 用户单选列表 SELECT_MEMBER_MULTI - 用户多选列表 TEXT_DATETIME - 日期时间选择框 TEXT_DATE - 日期选择框 TEXT_INTEGER - 整数输入框 TEXT_DECIMAL - 小数输入框 |
Description | String | 事项类型 |
Options | Array of IssueFieldOption | 选项列表 |
Unit | String | 单位 |
Selectable | Boolean | 项目中属性可选 |
Required | Boolean | 是否比天 |
Editable | Boolean | 是否可修改 |
Deletable | Boolean | 是否可删除 |
Sortable | Boolean | 是否可排序 |
CreatedBy | Integer | 创建者 |
CreatedAt | Long | 创建时间 |
UpdatedAt | Long | 修改时间 |
IssueFieldOption
参数名称 | 类型 | 描述 |
---|---|---|
Icon | String | 选项图标地址 |
Sort | String | 排序 |
Title | String | 选项标题 |
Value | String | 选项值 |
Example 1
成功示例
1{
2 "Action": "DescribeProjectIssueFieldList",
3 "ProjectName": "demo-project",
4 "IssueType": "REQUIREMENT"
5}
成功示例
1{
2 "Response": {
3 "RequestId": "b2f77ca4-a34c-efde-29aa-389940fc8673",
4 "ProjectIssueFieldList": [
5 {
6 "IssueFieldId": 1,
7 "NeedDefault": false,
8 "ValueString": "",
9 "IssueType": "REQUIREMENT",
10 "Required": false,
11 "IssueField": {
12 "Id": 1,
13 "TeamId": 1,
14 "Name": "处理人",
15 "IconUrl": "",
16 "Type": "ASSIGNEE",
17 "ComponentType": "SELECT_MEMBER_SINGLE",
18 "Description": "",
19 "Options": [],
20 "Unit": "",
21 "Selectable": false,
22 "Required": false,
23 "Editable": false,
24 "Deletable": false,
25 "Sortable": true,
26 "CreatedBy": 0,
27 "CreatedAt": 1597283395000,
28 "UpdatedAt": 1597283395000
29 },
30 "CreatedAt": 1597283400000,
31 "UpdatedAt": 1597283400000
32 },
33 {
34 "IssueFieldId": 8,
35 "NeedDefault": true,
36 "ValueString": "{\"type\":\"VARIABLE\",\"value\":\"CREATOR\"}",
37 "IssueType": "REQUIREMENT",
38 "Required": false,
39 "IssueField": {
40 "Id": 8,
41 "TeamId": 1,
42 "Name": "关注者",
43 "IconUrl": "",
44 "Type": "WATCHER",
45 "ComponentType": "SELECT_MEMBER_MULTI",
46 "Description": "",
47 "Options": [],
48 "Unit": "",
49 "Selectable": false,
50 "Required": false,
51 "Editable": false,
52 "Deletable": false,
53 "Sortable": true,
54 "CreatedBy": 0,
55 "CreatedAt": 1597283395000,
56 "UpdatedAt": 1597283395000
57 },
58 "CreatedAt": 1597283400000,
59 "UpdatedAt": 1598513658000
60 },
61 {
62 "IssueFieldId": 11,
63 "NeedDefault": false,
64 "ValueString": "",
65 "IssueType": "REQUIREMENT",
66 "Required": false,
67 "IssueField": {
68 "Id": 11,
69 "TeamId": 1,
70 "Name": "多选菜单",
71 "IconUrl": "",
72 "Type": "CUSTOM",
73 "ComponentType": "SELECT_MULTI",
74 "Description": "我的属性描述",
75 "Options": [
76 {
77 "Icon": "",
78 "Sort": "0",
79 "Title": "选项1",
80 "Value": "1"
81 },
82 {
83 "Icon": "",
84 "Sort": "1",
85 "Title": "选项2",
86 "Value": "2"
87 }
88 ],
89 "Unit": "",
90 "Selectable": true,
91 "Required": false,
92 "Editable": true,
93 "Deletable": true,
94 "Sortable": true,
95 "CreatedBy": 1,
96 "CreatedAt": 1598254806000,
97 "UpdatedAt": 1598594036000
98 },
99 "CreatedAt": 1598254851000,
100 "UpdatedAt": 1598428656000
101 },
102 {
103 "IssueFieldId": 13,
104 "NeedDefault": false,
105 "ValueString": "",
106 "IssueType": "REQUIREMENT",
107 "Required": false,
108 "IssueField": {
109 "Id": 13,
110 "TeamId": 1,
111 "Name": "单行文本",
112 "IconUrl": "",
113 "Type": "CUSTOM",
114 "ComponentType": "TEXT_SINGLE_LINE",
115 "Description": "",
116 "Options": [],
117 "Unit": "",
118 "Selectable": true,
119 "Required": false,
120 "Editable": true,
121 "Deletable": true,
122 "Sortable": true,
123 "CreatedBy": 1,
124 "CreatedAt": 1598513276000,
125 "UpdatedAt": 1598513276000
126 },
127 "CreatedAt": 1598513658000,
128 "UpdatedAt": 1598513658000
129 }
130 ]
131 }
132}
查询状态设置
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DescribeProjectIssueStatusList |
ProjectName | 是 | String | 项目名称 |
IssueType | 是 | String | 事项类型 DEFECT - 缺陷 REQUIREMENT - 需求 MISSION - 任务 EPIC - 史诗 SUB_TASK - 子任务 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
ProjectIssueStatusList | Array of ProjectIssueStatus | 项目状态列表 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
ProjectIssueStatus
参数名称 | 类型 | 描述 |
---|---|---|
IssueType | String | 事项类型 |
IssueStatusId | Integer | 事项状态 Id |
IsDefault | Boolean | 是否是默认值 |
CreatedAt | Long | 创建时间 |
UpdatedAt | Long | 修改时间 |
Sort | Integer | 排序 |
IssueStatus | String | 事项状态 |
IssueStatus
参数名称 | 类型 | 描述 |
---|---|---|
Id | Integer | 事项状态 Id |
Index | Integer | 状态序号 |
Name | String | 名称 |
Type | String | 类型,例如:TODO、PROCESSING、COMPLETED |
Description | String | 描述 |
IsSystem | Boolean | 是否是系统内置 |
CreatedAt | Long | 创建时间 |
UpdatedAt | Long | 修改时间 |
Example 1
成功示例
1{
2 "Action": "DescribeProjectIssueStatusList",
3 "ProjectName": "demo-project",
4 "IssueType": "REQUIREMENT"
5}
成功示例
1{
2 "Response": {
3 "RequestId": "dc827006-32db-a74f-eeae-13bec31c8b92",
4 "ProjectIssueStatusList": [
5 {
6 "IssueType": "REQUIREMENT",
7 "IssueStatusId": 4,
8 "IsDefault": true,
9 "CreatedAt": 1597283400000,
10 "UpdatedAt": 1597283400000,
11 "Sort": 0,
12 "IssueStatus": {
13 "Id": 4,
14 "Index": 3,
15 "Name": "未开始",
16 "Type": "TODO",
17 "Description": "",
18 "IsSystem": true,
19 "CreatedAt": 1597283396000,
20 "UpdatedAt": 1597283396000
21 }
22 },
23 {
24 "IssueType": "REQUIREMENT",
25 "IssueStatusId": 9,
26 "IsDefault": false,
27 "CreatedAt": 1597283400000,
28 "UpdatedAt": 1597283400000,
29 "Sort": 0,
30 "IssueStatus": {
31 "Id": 9,
32 "Index": 8,
33 "Name": "开发中",
34 "Type": "PROCESSING",
35 "Description": "",
36 "IsSystem": true,
37 "CreatedAt": 1597283396000,
38 "UpdatedAt": 1597283396000
39 }
40 },
41 {
42 "IssueType": "REQUIREMENT",
43 "IssueStatusId": 10,
44 "IsDefault": false,
45 "CreatedAt": 1597283400000,
46 "UpdatedAt": 1597283400000,
47 "Sort": 0,
48 "IssueStatus": {
49 "Id": 10,
50 "Index": 9,
51 "Name": "测试中",
52 "Type": "PROCESSING",
53 "Description": "",
54 "IsSystem": true,
55 "CreatedAt": 1597283396000,
56 "UpdatedAt": 1597283396000
57 }
58 },
59 {
60 "IssueType": "REQUIREMENT",
61 "IssueStatusId": 13,
62 "IsDefault": false,
63 "CreatedAt": 1597283400000,
64 "UpdatedAt": 1597283400000,
65 "Sort": 0,
66 "IssueStatus": {
67 "Id": 13,
68 "Index": 12,
69 "Name": "已完成",
70 "Type": "COMPLETED",
71 "Description": "",
72 "IsSystem": true,
73 "CreatedAt": 1597283396000,
74 "UpdatedAt": 1597283396000
75 }
76 }
77 ]
78 }
79}
修改事项
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:ModifyIssue |
ProjectName | 是 | String | 项目名称 |
IssueCode | 是 | Integer | 事项 Code |
ParentCode | 否 | Integer | 所属事项 Code |
Name | 是 | String | 事项名称 |
StatusId | 否 | Integer | 事项状态 Id |
AssigneeId | 否 | Integer | 指派人 Id |
DueDate | 否 | String | 截止日期 |
StartDate | 否 | String | 开始日期 |
WorkingHours | 否 | Double | 工时(小时) |
ProjectModuleId | 否 | Integer | 项目模块 Id |
WatcherIds | 否 | Array of Integer | 添加的事项关注人 Id 列表 |
DelWatcherIds | 否 | Array of Integer | 删除的事项关注人 Id 列表 |
DefectTypeId | 否 | Integer | 项目缺陷类型 Id |
RequirementTypeId | 否 | Integer | 项目需求类型 Id |
Priority | 否 | String | 优先级 "0" - 低 "1" - 中 "2" - 高 "3" - 紧急 |
StoryPoint | 否 | String | 故事点,例如:0.5、1 |
LabelIds | 否 | Array of Integer | 添加的标签 Id 列表 |
DelLabelIds | 否 | Array of Integer | 删除的标签 Id 列表 |
FileIds | 否 | Array of Integer | 添加的文件 Id 列表 |
DelFileIds | 否 | Array of Integer | 删除的文件 Id 列表 |
CustomFieldValues | 否 | Array of IssueCustomFieldForm | 自定义属性值列表 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Issue | IssueDetail | 事项信息 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
事项自定义属性
名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Id | 是 | Integer | 事项自定义属性 Id |
Content | 是 | String | 自定义属性值 多选值使用逗号 “,” 分隔 |
Example 1
成功示例
1{
2 "Action": "ModifyIssue",
3 "ProjectName": "demo-project",
4 "IssueCode": 3,
5 "Type": "REQUIREMENT",
6 "Name": "ceshi-20200817",
7 "Priority": "2",
8 "AssigneeId": 1
9}
成功示例
1{
2 "Response": {
3 "RequestId": "d68f3669-a9ee-ac91-dfec-95e80a134906",
4 "Issue": {
5 "ParentType": "REQUIREMENT",
6 "Code": 3,
7 "Type": "REQUIREMENT",
8 "Name": "ceshi-20200817",
9 "Description": "",
10 "IterationId": 1,
11 "IssueStatusId": 4,
12 "IssueStatusName": "未开始",
13 "IssueStatusType": "TODO",
14 "Priority": "2",
15 "Assignee": {
16 "Id": 1,
17 "Status": 2,
18 "GlobalKey": "coding",
19 "Avatar": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
20 "Media": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
21 "Name": "coding",
22 "Email": ""
23 },
24 "StartDate": 0,
25 "DueDate": 0,
26 "WorkingHours": 0,
27 "Creator": {
28 "Id": 1,
29 "Status": 2,
30 "GlobalKey": "coding",
31 "Avatar": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
32 "Media": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
33 "Name": "coding",
34 "Email": ""
35 },
36 "StoryPoint": "",
37 "CreatedAt": 1597895345000,
38 "UpdatedAt": 1598845197195,
39 "CompletedAt": 0,
40 "ProjectModule": {
41 "Id": 0,
42 "Name": ""
43 },
44 "Watchers": [
45 {
46 "Id": 1,
47 "Status": 2,
48 "GlobalKey": "coding",
49 "Avatar": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
50 "Media": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
51 "Name": "coding",
52 "Email": ""
53 }
54 ],
55 "Labels": [],
56 "Files": [],
57 "RequirementType": {
58 "Id": 0,
59 "Name": ""
60 },
61 "DefectType": {
62 "Id": 0,
63 "Name": "",
64 "IconUrl": ""
65 },
66 "CustomFields": [],
67 "ThirdLinks": [],
68 "SubTasks": [],
69 "Parent": {
70 "Code": 0,
71 "Type": "",
72 "Name": "",
73 "IssueStatusId": 0,
74 "IssueStatusName": "",
75 "Priority": "",
76 "Assignee": {
77 "Id": 0,
78 "Status": 0,
79 "GlobalKey": "",
80 "Avatar": "",
81 "Media": "",
82 "Name": "",
83 "Email": ""
84 }
85 },
86 "Epic": {
87 "Code": 0,
88 "Type": "",
89 "Name": "",
90 "IssueStatusId": 0,
91 "IssueStatusName": "",
92 "Priority": "",
93 "Assignee": {
94 "Id": 0,
95 "Status": 0,
96 "GlobalKey": "",
97 "Avatar": "",
98 "Media": "",
99 "Name": "",
100 "Email": ""
101 }
102 }
103 }
104 }
105}
查询后置事项
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DescribeBlockIssueList。 |
ProjectName | 是 | String | 项目名称 |
IssueCode | 是 | Integer | 事项 Code |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Issues | Array of IssueSimpleData | 后置事项列表 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
Example 1
成功示例
1{
2 "ProjectName": "project-demo",
3 "IssueCode": 1
4}
成功示例
1{
2 "Response": {
3 "Issues": [
4 {
5 "Code": 27,
6 "Type": "REQUIREMENT",
7 "Name": "xxx",
8 "IssueStatusId": 4,
9 "IssueStatusName": "未开始",
10 "IssueStatusType": "TODO",
11 "Priority": "3",
12 "Assignee": {
13 "Status": 1,
14 "Name": "xxx",
15 "Id": 1,
16 "Phone": "111",
17 "TeamId": 1,
18 "GlobalKey": "coding",
19 "Avatar": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
20 "Email": "coding.com",
21 "TeamGlobalKey": "coding"
22 }
23 },
24 {
25 "Code": 25,
26 "Type": "REQUIREMENT",
27 "Name": "xxx",
28 "IssueStatusId": 4,
29 "IssueStatusName": "未开始",
30 "IssueStatusType": "TODO",
31 "Priority": "3",
32 "Assignee": {
33 "Status": 1,
34 "Name": "xxx",
35 "Id": 1,
36 "Phone": "111",
37 "TeamId": 1,
38 "GlobalKey": "coding",
39 "Avatar": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
40 "Email": "coding.com",
41 "TeamGlobalKey": "coding"
42 }
43 }
44 ],
45 "RequestId": "1"
46 }
47}
查询前置事项
输入参数
以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见公共请求参数。
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DescribeBlockedByIssueList。 |
ProjectName | 是 | String | 项目名称 |
IssueCode | 是 | Integer | 事项 Code |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Issues | Array of IssueSimpleData | 前置事项列表 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
Example 1
成功示例
1{
2 "ProjectName": "project-demo",
3 "IssueCode": 1
4}
成功示例
1{
2 "Response": {
3 "Issues": [
4 {
5 "Code": 27,
6 "Type": "REQUIREMENT",
7 "Name": "xxx",
8 "IssueStatusId": 4,
9 "IssueStatusName": "未开始",
10 "IssueStatusType": "TODO",
11 "Priority": "3",
12 "Assignee": {
13 "Status": 1,
14 "Name": "xxx",
15 "Id": 1,
16 "Phone": "111",
17 "TeamId": 1,
18 "GlobalKey": "coding",
19 "Avatar": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
20 "Email": "coding.com",
21 "TeamGlobalKey": "coding"
22 }
23 },
24 {
25 "Code": 25,
26 "Type": "REQUIREMENT",
27 "Name": "xxx",
28 "IssueStatusId": 4,
29 "IssueStatusName": "未开始",
30 "IssueStatusType": "TODO",
31 "Priority": "3",
32 "Assignee": {
33 "Status": 1,
34 "Name": "xxx",
35 "Id": 1,
36 "Phone": "111",
37 "TeamId": 1,
38 "GlobalKey": "coding",
39 "Avatar": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
40 "Email": "coding.com",
41 "TeamGlobalKey": "coding"
42 }
43 }
44 ],
45 "RequestId": "1"
46 }
47}
查询子事项列表
输入参数
以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见公共请求参数。
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DescribeSubIssueList。 |
ProjectName | 是 | String | 项目名称 |
IssueCode | 是 | Integer | 事项 Code |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
SubIssueList | Array of IssueListData | 子事项列表 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
Example 1
成功示例
1{
2 "ProjectName": "project-demo",
3 "IssueCode": 1
4}
成功示例
1{
2 "Response": {
3 "SubIssueList": [
4 {
5 "ParentType": "REQUIREMENT",
6 "Code": 27,
7 "Type": "REQUIREMENT",
8 "Name": "xxx",
9 "Description": "",
10 "IterationId": 0,
11 "IssueStatusId": 4,
12 "IssueStatusName": "未开始",
13 "IssueStatusType": "TODO",
14 "Priority": "3",
15 "AssigneeId": 0,
16 "StartDate": 0,
17 "DueDate": 0,
18 "WorkingHours": 0,
19 "CreatorId": 1,
20 "StoryPoint": "0.5",
21 "CreatedAt": 1598843625000,
22 "UpdatedAt": 1598922564000,
23 "CompletedAt": 0
24 },
25 {
26 "ParentType": "REQUIREMENT",
27 "Code": 25,
28 "Type": "REQUIREMENT",
29 "Name": "xxx",
30 "Description": "",
31 "IterationId": 0,
32 "IssueStatusId": 4,
33 "IssueStatusName": "未开始",
34 "IssueStatusType": "TODO",
35 "Priority": "3",
36 "AssigneeId": 0,
37 "StartDate": 0,
38 "DueDate": 0,
39 "WorkingHours": 0,
40 "CreatorId": 1,
41 "StoryPoint": "2.0",
42 "CreatedAt": 1598517062000,
43 "UpdatedAt": 1598851550000,
44 "CompletedAt": 0
45 }
46 ],
47 "RequestId": "1"
48 }
49}
删除前置事项
输入参数
以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见公共请求参数。
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DeleteIssueBlock。 |
ProjectName | 是 | String | 项目名称 |
IssueCode | 是 | Integer | 事项 Code |
BlockIssueCode | 是 | Integer | 前置事项 Code |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
Example 1
成功示例
1{
2 "ProjectName": "project-demo",
3 "IssueCode": 1,
4 "BlockIssueCode": 4
5}
成功示例
1{
2 "Response": {
3 "RequestId": "1"
4 }
5}
添加前置事项
输入参数
以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见公共请求参数。
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:CreateIssueBlock。 |
ProjectName | 是 | String | 项目名称 |
IssueCode | 是 | Integer | 事项 Code |
BlockIssueCode | 是 | Integer | 前置事项 Code |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
Example 1
成功示例
1{
2 "ProjectName": "project-demo",
3 "IssueCode": 1,
4 "BlockIssueCode": 4
5}
成功示例
1{
2 "Response": {
3 "RequestId": "1"
4 }
5}
修改事项父需求
输入参数
以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见公共请求参数。
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:ModifyIssueParentRequirement。 |
ProjectName | 是 | String | 项目名称 |
IssueCode | 是 | Integer | 事项 Code |
ParentIssueCode | 是 | Integer | 父事项 Code |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
Example 1
成功示例
1{
2 "ProjectName": "project-demo",
3 "IssueCode": 10,
4 "ParentIssueCode": 1
5}
成功示例
1{
2 "Response": {
3 "RequestId": "1"
4 }
5}
创建迭代
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:CreateIteration |
ProjectName | 是 | String | 项目名称 |
Name | 是 | String | 标题 |
Goal | 否 | String | 目标 |
Assignee | 否 | Integer | 处理人 ID |
StartAt | 否 | String | 开始时间,格式:2020-01-01 |
EndAt | 否 | String | 结束时间,格式:2020-01-01 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Iteration | Iteration | 迭代的具体信息 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
迭代信息说明
名称 | 类型 | 描述 |
---|---|---|
Name | String | 标题 |
Code | Integer | 迭代编号,项目内唯一 |
Goal | String | 迭代目标 |
StartAt | Integer | 开始时间,时间戳,-28800000 代表没有设置 |
EndAt | Integer | 结束时间,时间戳,-28800000 代表没有设置 |
Assignee | Integer | 处理人 ID ,为 0 代表没有设置 |
Creator | Integer | 创建人 ID |
Starter | Integer | 开始人 ID |
Completer | Integer | 完成人 ID |
Status | String | 迭代状态:WAIT_PROCESS,PROCESSING,COMPLETED |
WaitProcessCount | Integer | 迭代中待处理事项总数 |
ProcessingCount | Integer | 迭代中进行中事项总数 |
CompletedCount | Integer | 迭代中完成事项总数 |
CompletedPercent | Float | 迭代中事项完成比率 |
CreatedAt | Integer | 创建时间 |
UpdatedAt | Integer | 修改时间 |
Example 1
成功示例
1{
2 "Action": "CreateIteration",
3 "ProjectName": "demo-project",
4 "Name": "Title"
5}
成功示例
1{
2 "Response": {
3 "RequestId": "1",
4 "Iteration": {
5 "CreatedAt": 1599027192347,
6 "UpdatedAt": 1599027192347,
7 "Name": "TT",
8 "Code": 8,
9 "Goal": "",
10 "StartAt": -28800000,
11 "EndAt": -28800000,
12 "Assignee": 0,
13 "Creator": 1,
14 "Deleter": 0,
15 "Starter": 0,
16 "Completer": 0,
17 "Status": "WAIT_PROCESS",
18 "WaitProcessCount": 0,
19 "ProcessingCount": 0,
20 "CompletedCount": 0,
21 "CompletedPercent": 0
22 }
23 }
24}
删除迭代
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DeleteIteration |
ProjectName | 是 | String | 项目名称 |
IterationCode | 是 | Integer | 迭代编号 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
Example 1
成功示例
1{
2 "Action": "DeleteIteration",
3 "ProjectName": "demo-project",
4 "IterationCode": 1
5}
成功示例
1{
2 "Response": {
3 "RequestId": "ae8e2d5f-569b-443e-8c61-440ea3a7562a"
4 }
5}
迭代详情
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DescribeIteration |
ProjectName | 是 | String | 项目名称 |
IterationCode | 是 | Integer | 迭代编号 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Iteration | Iteration | 迭代的具体信息 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
参数说明
名称 | 类型 | 描述 |
---|---|---|
Name | String | 标题 |
Code | Integer | 迭代编号,项目内唯一 |
Goal | String | 迭代目标 |
StartAt | Integer | 开始时间,时间戳,-28800000 代表没有设置 |
EndAt | Integer | 结束时间,时间戳,-28800000 代表没有设置 |
Assignee | Integer | 处理人 ID ,为 0 代表没有设置 |
Creator | Integer | 创建人 ID |
Starter | Integer | 开始人 ID |
Completer | Integer | 完成人 ID |
Status | String | 迭代状态:WAIT_PROCESS,PROCESSING,COMPLETED |
WaitProcessCount | Integer | 迭代中待处理事项总数 |
ProcessingCount | Integer | 迭代中进行中事项总数 |
CompletedCount | Integer | 迭代中完成事项总数 |
CompletedPercent | Float | 迭代中事项完成比率 |
CreatedAt | Integer | 创建时间 |
UpdatedAt | Integer | 修改时间 |
Example 1
成功示例
1{
2 "Action": "DescribeIteration",
3 "ProjectName": "project-demo",
4 "IterationCode": 1
5}
成功示例
1{
2 "Response": {
3 "RequestId": "1",
4 "Iteration": {
5 "CreatedAt": 1599027192347,
6 "UpdatedAt": 1599027192347,
7 "Name": "TT",
8 "Code": 8,
9 "Goal": "",
10 "StartAt": -28800000,
11 "EndAt": -28800000,
12 "Assignee": 0,
13 "Creator": 1,
14 "Deleter": 0,
15 "Starter": 0,
16 "Completer": 0,
17 "Status": "WAIT_PROCESS",
18 "WaitProcessCount": 0,
19 "ProcessingCount": 0,
20 "CompletedCount": 0,
21 "CompletedPercent": 0
22 }
23 }
24}
迭代列表
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DescribeIterationList |
ProjectName | 是 | String | 项目名称 |
Status | 否 | array of String | 迭代状态, WAIT_PROCESS,PROCESSING,COMPLETED |
Assignee | 否 | array of Integer | 处理人 ID 列表 |
StartDate | 否 | String | 通过开始时间过滤,时间格式:2020-12-12 |
EndDate | 否 | String | 通过结束时间过滤,时间格式:2020-12-12 |
keywords | 否 | String | 通过关键字搜索 |
Offset | 否 | Integer | 偏移量,默认 0 |
Limit | 否 | Integer | 每页数量,默认 20 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Data | Page of Iteration | 迭代的具体信息 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
参数说明
名称 | 类型 | 描述 |
---|---|---|
Name | String | 标题 |
Code | Integer | 迭代编号,项目内唯一 |
Goal | String | 迭代目标 |
StartAt | Integer | 开始时间,时间戳,-28800000 代表没有设置 |
EndAt | Integer | 结束时间,时间戳,-28800000 代表没有设置 |
Assignee | Integer | 处理人 ID ,为 0 代表没有设置 |
Creator | Integer | 创建人 ID |
Starter | Integer | 开始人 ID |
Completer | Integer | 完成人 ID |
Status | String | 迭代状态:WAIT_PROCESS,PROCESSING,COMPLETED |
WaitProcessCount | Integer | 迭代中待处理事项总数 |
ProcessingCount | Integer | 迭代中进行中事项总数 |
CompletedCount | Integer | 迭代中完成事项总数 |
CompletedPercent | Float | 迭代中事项完成比率 |
CreatedAt | Integer | 创建时间 |
UpdatedAt | Integer | 修改时间 |
Example 1
成功示例
1{
2 "Action": "DescribeIterationList",
3 "ProjectName": "demo-project",
4 "Status": [
5 "WAIT_PROCESS"
6 ]
7}
成功示例
1{
2 "Response": {
3 "RequestId": "1",
4 "data": {
5 "Page": 1,
6 "PageSize": 20,
7 "TotalPage": 1,
8 "TotalRow": 1,
9 "List": [
10 {
11 "CreatedAt": 1599027192000,
12 "UpdatedAt": 1599027192000,
13 "Name": "demo iteration",
14 "Code": 8,
15 "Goal": "",
16 "StartAt": -28800000,
17 "EndAt": -28800000,
18 "Assignee": 0,
19 "Creator": 1,
20 "Deleter": 0,
21 "Starter": 0,
22 "Completer": 0,
23 "Status": "WAIT_PROCESS",
24 "WaitProcessCount": 0,
25 "ProcessingCount": 0,
26 "CompletedCount": 0,
27 "CompletedPercent": 0
28 }
29 ]
30 }
31 }
32}
修改迭代
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:ModifyIteration |
ProjectName | 是 | String | 项目名称 |
IterationCode | 是 | Integer | 迭代编号 |
Name | 否 | String | 标题 |
Goal | 否 | String | 目标 |
Assignee | 否 | Integer | 处理人 ID |
StartAt | 否 | String | 开始时间,格式:2020-01-01 |
EndAt | 否 | String | 结束时间,格式:2020-01-01 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Iteration | Iteration | 迭代的具体信息 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
参数说明
名称 | 类型 | 描述 |
---|---|---|
Name | String | 标题 |
Code | Integer | 迭代编号,项目内唯一 |
Goal | String | 迭代目标 |
StartAt | Integer | 开始时间,时间戳,-28800000 代表没有设置 |
EndAt | Integer | 结束时间,时间戳,-28800000 代表没有设置 |
Assignee | Integer | 处理人 ID ,为 0 代表没有设置 |
Creator | Integer | 创建人 ID |
Starter | Integer | 开始人 ID |
Completer | Integer | 完成人 ID |
Status | String | 迭代状态:WAIT_PROCESS,PROCESSING,COMPLETED |
WaitProcessCount | Integer | 迭代中待处理事项总数 |
ProcessingCount | Integer | 迭代中进行中事项总数 |
CompletedCount | Integer | 迭代中完成事项总数 |
CompletedPercent | Float | 迭代中事项完成比率 |
CreatedAt | Integer | 创建时间 |
UpdatedAt | Integer | 修改时间 |
Example 1
成功示例
1{
2 "Action": "ModifyIteration",
3 "ProjectName": "demo-project",
4 "IterationCode": 1,
5 "Name": "Title"
6}
成功示例
1{
2 "Response": {
3 "RequestId": "1",
4 "Iteration": {
5 "CreatedAt": 1599027192347,
6 "UpdatedAt": 1599027192347,
7 "Name": "TT",
8 "Code": 8,
9 "Goal": "",
10 "StartAt": -28800000,
11 "EndAt": -28800000,
12 "Assignee": 0,
13 "Creator": 1,
14 "Deleter": 0,
15 "Starter": 0,
16 "Completer": 0,
17 "Status": "WAIT_PROCESS",
18 "WaitProcessCount": 0,
19 "ProcessingCount": 0,
20 "CompletedCount": 0,
21 "CompletedPercent": 0
22 }
23 }
24}
批量规划迭代
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:PlanIterationIssue |
ProjectName | 是 | String | 项目名称 |
IterationCode | 是 | Integer | 迭代编号,将事项移出迭代请传 0 |
IssueCode | 是 | array of Integer | 需要规划的事项编号列表 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
Example 1
成功示例
1{
2 "Action": "PlanIterationIssue",
3 "ProjectName": "demo-project",
4 "IterationCode": 1,
5 "IssueCode": [
6 1,
7 2
8 ]
9}
成功示例
1{
2 "Response": {
3 "RequestId": "ae8e2d5f-569b-443e-8c61-440ea3a7562a"
4 }
5}
查询工时日志列表
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DescribeIssueWorkLogList。 |
ProjectName | 是 | String | 项目名称 |
IssueCode | 是 | Integer | 事项 Code |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
WorkLogs | Array of IssueWorkLog | 工时日志列表 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
Example 1
成功示例
1{
2 "ProjectName": "project-demo",
3 "IssueCode": 1
4}
成功示例
1{
2 "Response": {
3 "WorkLogs": [
4 {
5 "WorkingDesc": "xx",
6 "IssueId": 1,
7 "RecordHours": 1,
8 "UserId": 1,
9 "Id": 1,
10 "CreatedAt": 1608689693852,
11 "RemainingHours": 2
12 }
13 ],
14 "RequestId": "1"
15 }
16}
登记工时
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:CreateIssueWorkHours。 |
ProjectName | 是 | String | 项目名称 |
IssueCode | 是 | Integer | 事项 Code |
SpendHour | 是 | Float | 使用工时 |
RemainingHour | 是 | Float | 剩余工时 |
StartAt | 是 | Integer | 开始时间戳 |
WorkingDesc | 否 | String | 工作描述 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
Example 1
成功示例
1{
2 "ProjectName": "project-demo",
3 "IssueCode": 1,
4 "SpendHour": 2,
5 "RemainingHour": 1,
6 "StartAt": "1608630452740",
7 "WorkingDesc": "xxx"
8}
成功示例
1{
2 "Response": {
3 "RequestId": "1"
4 }
5}
删除工时日志
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DeleteIssueWorkHours。 |
ProjectName | 是 | String | 项目名称 |
IssueCode | 是 | Integer | 事项 Code |
WorkHourLogId | 是 | Integer | 工时日志 Id |
RollbackRemainingHours | 是 | Boolean | 是否将该工时日志的使用工时归还到剩余工时,默认:false |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
Example 1
成功示例
1{
2 "ProjectName": "project-demo",
3 "IssueCode": 1,
4 "WorkHourLogId": 2,
5 "RollbackRemainingHours": true
6}
成功示例
1{
2 "Response": {
3 "RequestId": "xx"
4 }
5}
创建代码仓库
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
ProjectId | 是 | Integer | 项目 id |
DepotName | 是 | String | 仓库名称 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
DepotId | Integer | 仓库 id |
Example 1
成功示例
1{
2 "Action": "CreateGitDepot",
3 "ProjectId": 5001,
4 "DepotName": "my-demo"
5}
成功示例
1{
2 "Response": {
3 "RequestId": "4cc3caaa-ed3d-e610-d274-63694db9e81d",
4 "DepotId": 1001
5 }
6}
Example 1
成功示例
1{
2 "Action": "DeleteGitDepot",
3 "DepotId": 1759
4}
成功示例
1{
2 "Response": {
3 "RequestId": "4d7694ed-5818-3ea5-4834-a9d74cb2a594"
4 }
5}
创建提交注释
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
DepotId | 是 | Integer | 仓库 id |
CommitSha | 是 | String | 提交的 Sha |
Note | 是 | String | NotesRef |
CommitMessage | 是 | String | 提交信息 |
NotesRef | 否 | String | 注释分支 ref |
Example 1
成功示例
1{
2 "Action": "CreateGitCommitNote",
3 "DepotId": 1383,
4 "NotesRef": "refs/master",
5 "CommitSha": "5178d68bd3ee2a93733354884f0888584d671d7b",
6 "Note": "coding",
7 "CommitMessage": "coding"
8}
成功示例
1{
2 "Response": {
3 "RequestId": "d7b00b5b-00b6-fb21-d6f5-92c146f73e0f"
4 }
5}
查询项目下仓库信息列表
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
ProjectId | 是 | Integer | 项目 id |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
DepotData | DepotData | 返回信息包 |
DepotData 参数详情
参数名称 | 类型 | 描述 |
---|---|---|
Depots | DepotInfo | 仓库信息列表 |
DepotInfo 参数详情
参数名称 | 类型 | 描述 |
---|---|---|
Name | String | 仓库名称 |
HttpsUrl | String | https 的 url 路径 |
SshUrl | String | ssh 的 url 路径 |
Id | Integer | 仓库 id |
VcsType | String | 仓库类型 |
Example 1
成功示例
1{
2 "Action": "DescribeProjectDepotInfoList",
3 "ProjectId": 234
4}
成功示例
1{
2 "Response": {
3 "RequestId": "e1d658b4-7e89-febe-2072-e68a9d9852e3",
4 "DepotData": {
5 "Depots": [
6 {
7 "Name": "depot-1",
8 "HttpsUrl": "https://e.coding.net/demo/demo-project/depot-1.git",
9 "SshUrl": "git@e.coding.net:demo/demo-project/depot-1.git",
10 "Id": 1,
11 "VcsType": "git"
12 },
13 {
14 "Name": "depot-2",
15 "HttpsUrl": "https://e.coding.net/demo/demo-project/depot-2.git",
16 "SshUrl": "git@e.coding.net:demo/demo-project/depot-2.git",
17 "Id": 2,
18 "VcsType": "git"
19 },
20 {
21 "Name": "depot-3",
22 "HttpsUrl": "https://e.coding.net/demo/demo-project/depot-3.git",
23 "SshUrl": "git@e.coding.net:demo/demo-project/depot-3.git",
24 "Id": 3,
25 "VcsType": "svn"
26 }
27 ]
28 }
29 }
30}
查询仓库所有标签
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
DepotId | 是 | Integer | 仓库 id |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
GitTags | GitTag | tag 集合 |
Example 1
成功示例
1{
2 "Action": "DescribeGitTags",
3 "DepotId": 1001
4}
成功示例
1{
2 "Response": {
3 "RequestId": "05d4f18d-8602-ad9c-f6a2-8ad6f8f73127",
4 "GitTags": [
5 {
6 "TagName": "tag-demo1",
7 "Message": "this is tag-demo1"
8 },
9 {
10 "TagName": "tag-demo2",
11 "Message": "this is tag-demo2"
12 }
13 ]
14 }
15}
根据分支获取标签列表
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Branch | 是 | String | 合并请求 id |
DepotId | 是 | Integer | 仓库 id |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Tags | String | 标签列表 |
Example 1
成功示例
1{
2 "Action": "DescribeGitTagsByBranch",
3 "DepotId": 46,
4 "Branch": "master"
5}
成功示例
1{
2 "Response": {
3 "RequestId": "78b0fa3f-c793-ebb1-822d-82cbc83848e6",
4 "Tags": [
5 "v0.1.0",
6 "v0.2.0",
7 "v0.2.1",
8 "v0.3.0",
9 "v0.3.1",
10 "v0.4.0",
11 "v0.4.1"
12 ]
13 }
14}
获取提交注释
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
DepotId | 是 | Integer | 仓库 id |
CommitSha | 是 | String | 提交的 Sha |
NotesRef | 否 | String | 注释 分支 Ref |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
CommitNote | String | 提交注释 |
Example 1
成功示例
1{
2 "Action": "DescribeGitCommitNote",
3 "DepotId": 1383,
4 "CommitSha": "5178d68bd3ee2a93733354884f0888584d671d7b",
5 "NotesRef": "refs/master"
6}
成功示例
1{
2 "Response": {
3 "RequestId": "f2212265-890c-fb76-2154-794c2a395610",
4 "CommitNote": "coding"
5 }
6}
查询提交详情
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
DepotId | 是 | Integer | 仓库 id |
Sha | 是 | String | 提交的 Sha 值 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
GitCommit | Commit | 提交详情 |
Example 1
成功示例
1{
2 "Action": "DescribeGitCommit",
3 "DepotId": 1001,
4 "Sha": "bf778a27fa30a889a30af6362ba1f16a48dd58dd"
5}
成功示例
1{
2 "Response": {
3 "RequestId": "b4fe12f2-c21c-bdd7-5efd-e07dc7f28a31",
4 "GitCommit": {
5 "ShortMessage": "my-commit",
6 "Sha": "bf778a27fa30a889a30af6362ba1f16a48dd58dd",
7 "CommitDate": 1602817039000,
8 "Commiter": {
9 "Email": "mydemo@coding.com",
10 "Name": "洋葱猴"
11 }
12 }
13 }
14}
查询仓库分支下提交列表
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
DepotId | 是 | Integer | 仓库 id |
Ref | 是 | String | 分支名称 |
Path | 否 | String | 查询文件路径 |
PageNumber | 否 | Integer | 分页页码,默认为 1 |
PageSize | 否 | Integer | 分页页距,默认为 10 |
StartDate | 否 | String | 时间过滤起始点 |
EndDate | 否 | String | 时间过滤到达点 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Commits | Commit | 提交详情列表 |
Example 1
成功示例
1{
2 "Action": "DescribeGitCommits",
3 "DepotId": 1001,
4 "PageNumber": 1,
5 "PageSize": 20,
6 "Ref": "master",
7 "Path": "",
8 "StartDate": "",
9 "EndDate": ""
10}
成功示例
1{
2 "Response": {
3 "RequestId": "ae27609d-83a4-6a31-788c-c8d5c2ea9278",
4 "Commits": [
5 {
6 "ShortMessage": "commit 1",
7 "Sha": "bf778a27fa30a889a30af6362ba1f16a48dd58dd",
8 "CommitDate": 1602817039000,
9 "Commiter": {
10 "Email": "demo1@coding.com",
11 "Name": "洋葱猴"
12 }
13 },
14 {
15 "ShortMessage": "commit 2",
16 "Sha": "41f071ff685389db1d0a796dbd4770dd9c8931f0",
17 "CommitDate": 1602817003000,
18 "Commiter": {
19 "Email": "demo2@coding.com",
20 "Name": "洋葱猴"
21 }
22 }
23 ]
24 }
25}
两次提交之间的提交历史
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
DepotId | 是 | Integer | 仓库 id |
Source | 是 | String | 源请求 Sha 值,分支名称 |
Target | 是 | String | 目标请求 Sha 值,分支名称 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
DifferentOfCommitInfo | DifferentOfCommitInfo | 差异信息 |
参数详解
参数名称 | 类型 | 描述 |
---|---|---|
ShortMessage | String | 提交的消息 |
Sha | String | 提交的 Sha |
CommitDate | Integer | 提交的时间戳,单位毫秒 |
Path | String | 文件路径 |
Deletions | Integer | 删除的行数 |
Insertions | Integer | 新增的行数 |
Name | String | 提交名称 |
UpdateFileNum | Integer | 修改的文件数 |
Example 1
成功示例
1{
2 "Action": "DescribeCommitsBetween2Commit",
3 "DepotId": 5001,
4 "Source": "",
5 "Target": ""
6}
成功示例
1{
2 "Response": {
3 "RequestId": "ae841435-a933-d500-b363-c25d3843bfa3",
4 "DifferentOfCommitInfo": {
5 "Commits": [
6 {
7 "ShortMessage": "asdasd\n",
8 "Sha": "be9a51ea0dfb1a43e1e714db0e0ecad3009bf362",
9 "CommitDate": 1602668567000,
10 "Commiter": {
11 "Email": "coding@coding.com",
12 "Name": "coding"
13 }
14 }
15 ],
16 "DifferentOfCommits": [
17 {
18 "Path": "dada",
19 "Deletions": 0,
20 "Insertions": 1,
21 "Name": "dada"
22 }
23 ],
24 "Deletions": 0,
25 "Insertions": 1,
26 "UpdateFileNum": 1
27 }
28 }
29}
两次提交之间的文件差异
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
DepotId | 是 | Integer | 仓库 id |
Source | 是 | String | 源请求 Sha 值,分支名称 |
Target | 是 | String | 目标请求 Sha 值,分支名称 |
Path | 是 | String | 文件位置 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
DiffFileInfo | DiffFileInfo | 文件差异信息 |
参数详解
参数名称 | 类型 | 描述 |
---|---|---|
Index | Integer | 排序号,由小到大递增 |
LeftNo | Integer | 操作起始行号 |
Prefix | Integer | 操作方式:"+"表示新增,"-"表示删除," "表示不变 |
RightNo | Integer | 操作结束行号 |
Text | String | 文本 |
Deletions | Integer | 总删除行数 |
Insertions | Integer | 总新增行数 |
Example 1
成功示例
1{
2 "Action": "DescribeDifferentBetween2Commits",
3 "DepotId": 5001,
4 "Source": "master",
5 "Target": "dev",
6 "Path": "root/test.java"
7}
成功示例
1{
2 "Response": {
3 "RequestId": "8122c513-7ad1-878c-6187-a764b4616a79",
4 "DiffFileInfo": {
5 "DifferentLines": [
6 {
7 "Index": 0,
8 "LeftNo": 0,
9 "Prefix": " ",
10 "RightNo": 0,
11 "Text": "@@ -0,0 +1 @@\n"
12 },
13 {
14 "Index": 1,
15 "LeftNo": 1,
16 "Prefix": "+",
17 "RightNo": 1,
18 "Text": "dsafdasdfas\\ No newline at end of file"
19 }
20 ],
21 "Deletions": 0,
22 "Insertions": 1
23 }
24 }
25}
创建标签
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
DepotId | 是 | Integer | 仓库 id |
StartPoint | 是 | String | 创建来源 |
TagName | 是 | String | tag 名称 |
Message | 是 | String | 描述 |
Example 1
成功示例
1{
2 "Action": "CreateGitTag",
3 "DepotId": 1001,
4 "TagName": "tag-demo",
5 "StartPoint": "master",
6 "message": "this is my create tag demo"
7}
成功示例
1{
2 "Response": {
3 "RequestId": "b6445913-3b7c-9907-c6b3-a2d63abfd5c6"
4 }
5}
Example 1
成功示例
1{
2 "Action": "DeleteGitTag",
3 "DepotId": 1001,
4 "TagName": "tag-demo"
5}
成功示例
1{
2 "Response": {
3 "RequestId": "aa9dc0b9-6c8c-ed2c-ac54-191b40a63e81"
4 }
5}
查询指定标签
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
DepotId | 是 | Integer | 仓库 id |
TagName | 是 | String | tag 名称 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
GitTag | GitTag | tag |
Example 1
成功示例
1{
2 "Action": "DescribeGitTag",
3 "DepotId": 1001,
4 "TagName": "tag-demo"
5}
成功示例
1{
2 "Response": {
3 "RequestId": "a3a852b3-3d5a-d87f-fe9a-7ea8af9e22ed",
4 "GitTag": {
5 "TagName": "tag-demo",
6 "Message": "this is a tag-demo"
7 }
8 }
9}
查询仓库所有标签
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
DepotId | 是 | Integer | 仓库 id |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
GitTags | GitTag | tag 集合 |
Example 1
成功示例
1{
2 "Action": "DescribeGitTags",
3 "DepotId": 1001
4}
成功示例
1{
2 "Response": {
3 "RequestId": "05d4f18d-8602-ad9c-f6a2-8ad6f8f73127",
4 "GitTags": [
5 {
6 "TagName": "tag-demo1",
7 "Message": "this is tag-demo1"
8 },
9 {
10 "TagName": "tag-demo2",
11 "Message": "this is tag-demo2"
12 }
13 ]
14 }
15}
根据分支获取标签列表
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Branch | 是 | String | 合并请求 id |
DepotId | 是 | Integer | 仓库 id |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Tags | String | 标签列表 |
Example 1
成功示例
1{
2 "Action": "DescribeGitTagsByBranch",
3 "DepotId": 46,
4 "Branch": "master"
5}
成功示例
1{
2 "Response": {
3 "RequestId": "78b0fa3f-c793-ebb1-822d-82cbc83848e6",
4 "Tags": [
5 "v0.1.0",
6 "v0.2.0",
7 "v0.2.1",
8 "v0.3.0",
9 "v0.3.1",
10 "v0.4.0",
11 "v0.4.1"
12 ]
13 }
14}
创建分支
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
DepotId | 是 | Integer | 仓库 id |
BranchName | 是 | String | 要创建的仓库名称 |
StartPoint | 是 | String | 源分支名称 |
Example 1
成功示例
1{
2 "Action": "CreateGitBranch",
3 "DepotId": 1001,
4 "BranchName": "branch-demo",
5 "StartPoint": "master"
6}
成功示例
1{
2 "Response": {
3 "RequestId": "be249809-0852-bd61-1420-c7d66e5038a9"
4 }
5}
删除分支
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
DepotId | 是 | Integer | 仓库 id |
BranchName | 是 | String | 要创建的仓库名称 |
Example 1
成功示例
1{
2 "Action": "DeleteGitBranch",
3 "DepotId": 1001,
4 "BranchName": "branch-demo"
5}
成功示例
1{
2 "Response": {
3 "RequestId": "30892813-210d-a1cf-10bd-ca11cb1e271a"
4 }
5}
查询分支信息
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
DepotId | 是 | Integer | 仓库 id |
BranchName | 是 | String | 分支名称 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
GitBranch | GitBranch | 分支详情 |
Example 1
成功示例
1{
2 "Action": "DescribeGitBranch",
3 "DepotId": 1001,
4 "BranchName": "master"
5}
成功示例
1{
2 "Response": {
3 "RequestId": "fd1d65dd-5c9d-df50-e348-7d3bf0f31f53",
4 "GitBranch": {
5 "BranchName": "master",
6 "IsDefaultBranch": true,
7 "IsProtected": false,
8 "Sha": "bf778a27fa30a889a30af6362ba1f16a48dd58dd"
9 }
10 }
11}
查询所有分支信息
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
DepotId | 是 | Integer | 仓库 id |
PageNumber | 否 | Integer | 分页页码,默认为 1 |
PageSize | 否 | Integer | 分页页距,默认为 10 |
KeyWord | 否 | String | 关键词 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Branches | GitBranch | 分支列表 |
TotalCount | Integer | 总条数 |
Example 1
成功示例
1{
2 "Action": "DescribeGitBranches",
3 "DepotId": 1001,
4 "PageNumber": 1,
5 "PageSize": 20,
6 "KeyWord": ""
7}
成功示例
1{
2 "Response": {
3 "RequestId": "7c57d93d-e731-6150-8575-b3bf68f11b05",
4 "TotalCount": 4,
5 "Branches": [
6 {
7 "BranchName": "master",
8 "IsDefaultBranch": true,
9 "IsProtected": false,
10 "Sha": "92811220f02b7c9f1ef5559c74ced479f271c905"
11 },
12 {
13 "BranchName": "branch-1",
14 "IsDefaultBranch": false,
15 "IsProtected": false,
16 "Sha": "92811220f02b7c9f1ef5559c74ced479f271c905"
17 },
18 {
19 "BranchName": "branch-2",
20 "IsDefaultBranch": false,
21 "IsProtected": false,
22 "Sha": "92811220f02b7c9f1ef5559c74ced479f271c905"
23 },
24 {
25 "BranchName": "branch-3",
26 "IsDefaultBranch": false,
27 "IsProtected": false,
28 "Sha": "92811220f02b7c9f1ef5559c74ced479f271c905"
29 }
30 ]
31 }
32}
查询提交所在分支
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
DepotId | 是 | Integer | 仓库 id |
Sha | 是 | String | 提交的 Sha 值 |
Example 1
成功示例
1{
2 "Action": "DescribeGitBranchesBySha",
3 "DepotId": 1001,
4 "Sha": "bf778a27fa30a889a30af6362ba1f16a48dd58dd"
5}
成功示例
1{
2 "Response": {
3 "RequestId": "f16f5a85-9b8d-42f3-84aa-d9061941bad5",
4 "Refs": [
5 {
6 "Ref": "master"
7 }
8 ]
9 }
10}
添加保护分支成员
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
DepotId | 是 | Integer | 仓库 id |
BranchName | 是 | String | 分支名称 |
GlobalKey | 是 | String | 需要添加用户的 global_key |
Example 1
成功示例
1{
2 "Action": "CreateProtectedBranchMember",
3 "DepotId": 5001,
4 "BranchName": "master",
5 "GlobalKey": "GlobalKeyDemo"
6}
成功示例
1{
2 "Response": {
3 "RequestId": "6f2811dc-dd28-f099-86cc-f15dbeb8fd0e"
4 }
5}
设置保护分支
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
DepotId | 是 | Integer | 仓库 id |
BranchName | 是 | String | 分支名称 |
Example 1
成功示例
1{
2 "Action": "CreateProtectedBranch",
3 "DepotId": 5001,
4 "BranchName": "master"
5}
成功示例
1{
2 "Response": {
3 "RequestId": "2cf6e3b6-7fa7-0433-50b1-73e6226ac15b"
4 }
5}
查询所有保护分支
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
DepotId | 是 | Integer | 仓库 id |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
ProtectedBranchs | ProtectedBranch | 保护分支列表 |
参数详解
参数名称 | 类型 | 描述 |
---|---|---|
CommitDate | Integer | 提交时间戳,单位毫秒 |
DenyForcePush | bool | 是否禁止强制推送 |
ForceSquash | bool | 是否使用 squash 推送 |
Name | String | 名称 |
StatusCheck | bool | 是否开启状态检查 |
Example 1
成功示例
1{
2 "Action": "DescribeProtectedBranchs",
3 "DepotId": 5001
4}
成功示例
1{
2 "Response": {
3 "RequestId": "80ca5636-b61b-2419-15a2-0ca80e8f1acd",
4 "ProtectedBranchs": [
5 {
6 "CommitDate": 1602668567000,
7 "DenyForcePush": true,
8 "ForceSquash": false,
9 "Name": "master",
10 "StatusCheck": false
11 },
12 {
13 "CommitDate": 1601279380000,
14 "DenyForcePush": true,
15 "ForceSquash": false,
16 "Name": "branch1",
17 "StatusCheck": false
18 },
19 {
20 "CommitDate": 1601279380000,
21 "DenyForcePush": true,
22 "ForceSquash": false,
23 "Name": "branch2",
24 "StatusCheck": false
25 },
26 {
27 "CommitDate": 1601279380000,
28 "DenyForcePush": true,
29 "ForceSquash": false,
30 "Name": "branch3",
31 "StatusCheck": false
32 }
33 ]
34 }
35}
查询所有保护分支成员
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
DepotId | 是 | Integer | 仓库 id |
BranchName | 是 | String | 分支名称 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Members | ProtectedBranchMember | 保护分支用户列表 |
参数详解
参数名称 | 类型 | 描述 |
---|---|---|
HasPushAccess | bool | 是否允许强制推送 |
HasUpdateAccess | bool | 是否允许合并修改分支 |
Name | String | 名称 |
GlobalKey | String | 用户 globalkey |
Example 1
成功示例
1{
2 "Action": "DescribeProtectedBranchMembers",
3 "DepotId": 5001
4}
成功示例
1{
2 "Response": {
3 "RequestId": "9aaf9eb9-f9fd-696b-ca60-4a6d4846ca3c",
4 "Members": [
5 {
6 "HasPushAccess": true,
7 "HasUpdateAccess": true,
8 "Name": "洋葱猴",
9 "GlobalKey": "coding-demo"
10 },
11 {
12 "HasPushAccess": true,
13 "HasUpdateAccess": true,
14 "Name": "洋葱猴2号",
15 "GlobalKey": "lSwLndttrs"
16 }
17 ]
18 }
19}
查询保护分支状态
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
DepotId | 是 | Integer | 仓库 id |
BranchName | 是 | String | 分支名称 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
ProtectedBranch | ProtectedBranch | 保护分支详情 |
参数详解
参数名称 | 类型 | 描述 |
---|---|---|
CommitDate | Integer | 提交时间戳,单位毫秒 |
DenyForcePush | bool | 是否禁止强制推送 |
ForceSquash | bool | 是否使用 squash 推送 |
Name | String | 名称 |
StatusCheck | bool | 是否开启状态检查 |
Example 1
成功示例
1{
2 "Action": "DescribeProtectedBranch",
3 "DepotId": 5001
4}
成功示例
1{
2 "Response": {
3 "RequestId": "129c2dc2-223e-4ee6-0643-26a50fb4b5ba",
4 "ProtectedBranch": {
5 "CommitDate": 1601279380000,
6 "DenyForcePush": true,
7 "ForceSquash": false,
8 "Name": "master",
9 "StatusCheck": false
10 }
11 }
12}
获取合并请求提交记录
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
MergeId | 是 | Integer | 合并请求 id |
DepotId | 是 | Integer | 仓库 id |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Commits | Commit | 请求提交列表 |
参数详解
参数名称 | 类型 | 描述 |
---|---|---|
ShortMessage | String | 提交消息 |
Sha | String | 提交 sha 值 |
CommitDate | Integer | 提交时间戳 |
Commiter | Commiter | 提交者 |
Commiter 参数详解
参数名称 | 类型 | 描述 |
---|---|---|
String | email 地址 | |
Name | String | 姓名 |
Example 1
成功示例
1{
2 "Action": "DescribeMergeRequestCommits",
3 "DepotId": 46,
4 "MergeId": 5
5}
成功示例
1{
2 "Response": {
3 "RequestId": "e846cfdb-e842-08a5-7fa3-a484d63fa250",
4 "Commits": [
5 {
6 "ShortMessage": "commit-1\n",
7 "Sha": "7c86071af40405abad16c90dcf6cb72abcf8184d",
8 "CommitDate": 1604478235000,
9 "Commiter": {
10 "Email": "coding@coding.com",
11 "Name": "洋葱猴1"
12 }
13 },
14 {
15 "ShortMessage": "commit-2\n",
16 "Sha": "12908c5ab917d2b9829378cd21355d3a42df432a",
17 "CommitDate": 1604478219000,
18 "Commiter": {
19 "Email": "coding2@coding.com",
20 "Name": "洋葱猴2"
21 }
22 },
23 {
24 "ShortMessage": "commit-3\n",
25 "Sha": "568f4d10256685d3301e95557f2511e38336f38c",
26 "CommitDate": 1604478188000,
27 "Commiter": {
28 "Email": "coding3@coding.com",
29 "Name": "洋葱猴3"
30 }
31 }
32 ]
33 }
34}
查询合并请求详情
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
MergeId | 是 | Integer | 合并请求 id |
DepotId | 是 | Integer | 仓库 id |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
MergeRequestInfo | MergeRequestInfo | 合并相关信息 |
参数详解
参数名称 | 类型 | 描述 |
---|---|---|
Describe | String | 描述,为 markdown 格式 |
Status | String | 合并状态 |
Title | String | 合并标题 |
TargetBranch | String | 目标分支 |
SourceBranch | bool | 源分支 |
合并状态值
值 | 对应状态 |
---|---|
CANMERGE | 状态可自动合并 |
ACCEPTED | 状态已接受 |
CANNOTMERGE | 状态不可自动合并 |
REFUSED | 状态已拒绝(关闭) |
CANCEL | 取消 |
MERGING | 正在合并中 |
ABNORMAL | 状态异常 |
Example 1
成功示例
1{
2 "Action": "DescribeMergeRequest",
3 "DepotId": 46,
4 "MergeId": 5
5}
成功示例
1{
2 "Response": {
3 "RequestId": "bcc8760c-5abf-ab67-f88c-f29befab2c8e",
4 "MergeRequestInfo": {
5 "Describe": "## 改动说明\n[scheduler]仓库导入同步。开发人员:@洋葱猴`\n## 测试要点\n\n无",
6 "Status": "ACCEPTED",
7 "Title": "测试合并",
8 "TargetBranch": "master",
9 "SourceBranch": "dev"
10 }
11 }
12}
获取合并请求文件修改记录
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
MergeId | 是 | Integer | 合并请求 id |
DepotId | 是 | Integer | 仓库 id |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
MergeRequestFileDiff | MergeRequestFileDiff | 文件修改记录 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
MergeRequestFileDiff | MergeRequestFileDiff | 文件修改记录 |
MergeRequestFileDiff 参数详情
参数名称 | 类型 | 描述 |
---|---|---|
FileDiffs | FileDiff | 文件差别列表 |
Deletions | Integer | 总删除行数 |
Insertions | Integer | 总新增行数 |
OldSha | String | 旧请求的 sha 值 |
NewSha | String | 新请求的 sha 值 |
FileDiff 参数详情
参数名称 | 类型 | 描述 |
---|---|---|
ChangeType | String | 操作类型 |
Deletions | Integer | 总删除行数 |
Insertions | Integer | 总新增行数 |
ObjectId | String | objectId |
Path | String | 文件路径 |
ChangeType 参数详情
值 | 状态 |
---|---|
ADD | 添加 |
MODIFY | 修改 |
DELETE | 删除 |
REPLACE | 替换 |
Example 1
成功示例
1{
2 "Action": "DescribeMergeRequestFileDiff",
3 "DepotId": 46,
4 "MergeId": 5
5}
成功示例
1{
2 "Response": {
3 "RequestId": "7dc24d8c-7dbc-3f62-0571-39c92a347ba4",
4 "MergeRequestFileDiff": {
5 "FileDiffs": [
6 {
7 "ChangeType": "ADD",
8 "Deletions": 0,
9 "Insertions": 1,
10 "ObjectId": "4868155eaef0a678c55181286d89fd85c4261631",
11 "Path": "demo.txt"
12 },
13 {
14 "ChangeType": "DELETE",
15 "Deletions": 1,
16 "Insertions": 0,
17 "ObjectId": "00092a3577f35a6482ab92fa4061cfaf22c1e4d1",
18 "Path": "demo2.txt"
19 },
20 {
21 "ChangeType": "ADD",
22 "Deletions": 0,
23 "Insertions": 1,
24 "ObjectId": "4d24b63b49b0759406294ee9fb9986ed0606bb39",
25 "Path": "demo3.txt"
26 }
27 ],
28 "Deletions": 1,
29 "Insertions": 2,
30 "OldSha": "b1c78397d7465a719b92ba41adac6e1c8bccfcdb",
31 "NewSha": "7c86071af40405abad16c90dcf6cb72abcf8184d"
32 }
33 }
34}
获取合并请求操作记录
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
MergeId | 是 | Integer | 合并请求 id |
DepotId | 是 | Integer | 仓库 id |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Logs | MergeRequestLog | 操作记录列表 |
参数详解
参数名称 | 类型 | 描述 |
---|---|---|
Id | Integer | ID |
Action | String | 操作方式 |
Name | String | 操作用户姓名 |
Example 1
成功示例
1{
2 "Action": "DescribeMergeRequestLog",
3 "DepotId": 46,
4 "MergeId": 5
5}
成功示例
1{
2 "Response": {
3 "RequestId": "e9fb2397-f4c5-e3f7-4f10-5fe8aec3c6ae",
4 "Logs": [
5 {
6 "Id": 1280,
7 "Action": "create",
8 "Name": "洋葱猴1"
9 },
10 {
11 "Id": 1281,
12 "Action": "update_content",
13 "Name": "洋葱猴2"
14 }
15 ]
16 }
17}
获取 commit note 列表
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
DepotId | 是 | Integer | 仓库 id |
NoteRef | 是 | String | note 路径 |
Commits | 是 | String | commitId 集合 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Notes | CommitNote | note 信息集合 |
CommitNote 输出参数详情
参数名称 | 类型 | 描述 |
---|---|---|
CommitSha | string | commitSha 值 |
NoteContent | string | note 值 |
Example 1
成功示例
1{
2 "Action": "DescribeNotesByCommits",
3 "DepotId": 7323,
4 "NoteRef": "refs/notes/commits",
5 "Commits": [
6 "commitSha1",
7 "commitSha2"
8 ]
9}
成功示例
1{
2 "Response": {
3 "RequestId": "c1c83461-dd49-3092-6ccd-4eecbabbd8aa",
4 "Notes": [
5 {
6 "CommitSha": "commitSha1",
7 "NoteContent": "note 1"
8 },
9 {
10 "CommitSha": "commitSha2",
11 "NoteContent": "note 2"
12 }
13 ]
14 }
15}
创建构建计划
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:CreateCodingCIJob。 |
ProjectId | 是 | Integer | 项目 ID |
DepotId | 是 | Integer | 仓库 ID |
Name | 是 | String | 构建计划名称 |
ExecuteIn | 是 | String | 执行方式 CVM | STATIC | AGENT |
HookType | 是 | String | 代码更新触发匹配规则 DEFAULT,TAG,BRANCH,CUSTOM |
JenkinsFileFromType | 是 | String | STATIC,SCM 从代码库读取 |
AutoCancelSameRevision | 是 | Boolean | 自动取消相同版本 |
AutoCancelSameMergeRequest | 是 | Boolean | 自动取消相同 MR |
JobFromType | 是 | String | 构建计划来源 TKE TCB |
DepotType | 是 | String | 仓库类型 CODING_OTHER_PROJ,CODING,TGIT,GITHUB,GITLAB,GITLAB_PRIVATE,GITEE,COMMON_GIT_REPO,NONE |
TriggerMethodList.N | 否 | Array of String | REF_CHANGE 代码更新触发 CRON = 1 定时触发 MR_CHANGE MR变动触发 |
BranchSelector | 否 | String | hookType 为 DEFAULT 时须指定 |
BranchRegex | 否 | String | hookType 为 CUSTOME 时须指定 |
JenkinsFilePath | 否 | String | JenkinsFileFromType 为 SCM 必填 |
JenkinsFileStaticContent | 否 | String | JenkinsFileFromType 为 STATIC 必填 |
TriggerRemind | 否 | String | 构建结果通知触发者机制 ALWAYS -总是通知; BUILD_FAIL -仅构建失败时通知; |
CachePathList.N | 否 | Array of CodingCIJobCachePath | 任务缓存目录配置 |
EnvList.N | 否 | Array of CIJobEnv | 环境变量配置 |
ScheduleList.N | 否 | Array of CodingCIJobSchedule | 针对 CRON triggerMethod 的 schedule 规则配置, 暂只用于添加 |
AlwaysUserIdList.N | 否 | Array of Integer | 不管构建成功还是失败总是通知的用户 |
BuildFailUserIdList.N | 否 | Array of Integer | 仅构建失败时要通知的用户 |
ExecutedAgentPoolId | 否 | Integer | 自定义构建节点池 ID,ExecuteIn 为 AGENT 必填 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Data | CreateCodingCIJobData | 创建构建计划返回结构 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
CodingCIJobCachePath
CI 任务缓存目录配置
名称 | 类型 | 必选 | 描述 |
---|---|---|---|
AbsolutePath | String | 是 | 绝对路径 |
Enabled | Boolean | 是 | 是否启用 |
CreateCodingCIJobData
创建构建计划返回值
名称 | 类型 | 必选 | 描述 |
---|---|---|---|
Id | Integer | 是 | 构建计划 Id |
CIJobEnv
环境变量配置
名称 | 类型 | 必选 | 描述 |
---|---|---|---|
Name | String | 是 | 环境变量名称 |
Value | String | 是 | 环境变量值 |
Sensitive | Boolean | 是 | 是否保密 |
CodingCIJobSchedule
针对 CRON TriggerMethod 的设置
名称 | 类型 | 必选 | 描述 |
---|---|---|---|
RefChangeTrigger | Boolean | 是 | 代码无变化时是否触发 |
Branch | String | 是 | 目标触发的分支 |
Weekend | String | 是 | 星期几 |
Repeat | Boolean | 是 | 是否周期触发(周期触发/单次触发) |
StartTime | String | 是 | 开始时间。如果是周期触发,精确到小时( 8 )如果是单次触发,精确到分钟数( 8:20 ) |
EndTime | String | 是 | 结束时间。如果是单次触发,结束时间为空 |
Interval | String | 是 | 间隔 |
Example 1
成功示例
1{
2 "Action": "DescribeCodingCIBuild",
3 "BuildId": 1
4}
成功示例
1{
2 "Response": {
3 "RequestId": "1",
4 "Data": {
5 "Id": 24
6 }
7 }
8}
查询构建完整日志(原始日志 Raw)
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DescribeCodingCIBuildLogRaw。 |
BuildId | 是 | Integer | 构建 ID |
Start | 是 | Integer | 日志开始位置 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Data | DescribeCodingCIBuildLogRawData | 构建原始日志 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
DescribeCodingCIBuildLogRawData
构建完整的日志
名称 | 类型 | 描述 |
---|---|---|
Raw | String | 日志 |
Example 1
成功示例
1{
2 "Action": "DescribeCodingCIBuildLogRaw",
3 "BuildId": 56,
4 "Start": 0
5}
成功示例
1{
2 "Response": {
3 "RequestId": "1"
4 }
5}
触发构建
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:TriggerCodingCIBuild。 |
JobId | 是 | Integer | 构建计划 Id |
Revision | 否 | String | 分支名或 CommitId,当为构建计划的 DepotType 为 NONE 是可不传 |
ParamList | 否 | Array of CodingCIJobEnv | 构建附加的环境变量 |
Reentrant | 否 | String | 可重入字符串 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Data | TriggerCodingCIBuildData | 构建信息 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
CIJobEnv
环境变量配置
名称 | 类型 | 必选 | 描述 |
---|---|---|---|
Name | String | 是 | 环境变量名称 |
Value | String | 是 | 环境变量值 |
Sensitive | Boolean | 是 | 是否保密 |
触发构建的参数
Example 1
成功示例
1{
2 "Action": "TriggerCodingCIBuild",
3 "Revision": "master",
4 "JobId": 23
5}
成功示例
1{
2 "Response": {
3 "RequestId": "1",
4 "Data": {
5 "Build": {
6 "Id": 55,
7 "JobId": 23,
8 "CodingCIId": "cci-2-605077",
9 "Number": 2,
10 "CommitId": "14c8e6e51ea01fc916dbcaf416f79a68f42c7634",
11 "Cause": "coding 手动触发",
12 "Branch": "",
13 "FailedMessage": "",
14 "JenkinsFileContent": "pipeline {\n agent any\n stages {\n \n stage(\"检出\") {\n steps {\n checkout(\n [$class: 'GitSCM', branches: [[name: env.GIT_BUILD_REF]], \n userRemoteConfigs: [[url: env.GIT_REPO_URL, credentialsId: env.CREDENTIALS_ID]]]\n )\n }\n }\n\n stage(\"构建\") {\n steps {\n echo \"构建中...\"\n sh 'docker version'\n // 请在这里放置您项目代码的单元测试调用过程,例如:\n // sh 'mvn package' // mvn 示例\n // sh 'make' // make 示例\n echo \"构建完成.\"\n \n // 演示怎样产生构建物\n script{\n def exists = fileExists 'README.md'\n if (!exists) {\n writeFile(file: 'README.md', text: 'Helloworld')\n }\n }\n archiveArtifacts artifacts: 'README.md', fingerprint: true\n \n // archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true // 收集构建产物\n }\n }\n\n stage(\"测试\") {\n steps {\n echo \"单元测试中...\"\n // 请在这里放置您项目代码的单元测试调用过程,例如:\n // sh 'mvn test' // mvn 示例\n // sh 'make test' // make 示例\n echo \"单元测试完成.\"\n \n // 演示怎么样生成测试报告\n writeFile(file: 'TEST-demo.junit4.AppTest.xml', text: '''\n <testsuite name=\"demo.junit4.AppTest\" time=\"0.053\" tests=\"3\" errors=\"0\" skipped=\"0\" failures=\"0\">\n <properties>\n </properties>\n <testcase name=\"testApp\" classname=\"demo.junit4.AppTest\" time=\"0.003\"/>\n <testcase name=\"test1\" classname=\"demo.junit4.AppTest\" time=\"0\"/>\n <testcase name=\"test2\" classname=\"demo.junit4.AppTest\" time=\"0\"/>\n </testsuite>\n ''')\n junit '*.xml'\n \n // junit 'target/surefire-reports/*.xml' // 收集单元测试报告的调用过程\n }\n }\n\n stage(\"部署\") {\n steps {\n echo \"部署中...\"\n // 请在这里放置收集单元测试报告的调用过程,例如:\n // sh 'mvn tomcat7:deploy' // Maven tomcat7 插件示例:\n // sh './deploy.sh' // 自研部署脚本\n echo \"部署完成\"\n }\n }\n }\n}\n",
15 "Duration": 0,
16 "Status": "QUEUED",
17 "StatusNode": "",
18 "TestResult": {
19 "Empty": false,
20 "FailCount": 0,
21 "PassCount": 0,
22 "SkipCount": 0,
23 "TotalCount": 0,
24 "Duration": 0
25 },
26 "CreatedAt": 1589084450366
27 }
28 }
29 }
30}
查询构建记录详情
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DescribeCodingCIBuild。 |
Version | 是 | String | 公共参数,本接口取值:2019-10-21。 |
Region | 否 | String | 公共参数,本接口不需要传递此参数。 |
BuildId | 是 | Integer | 构建 ID |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Build | CodingCIBuild | 构建详情 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
CodingCIBuild
CodingCiBuild 结构
名称 | 类型 | 必选 | 描述 |
---|---|---|---|
Id | Integer | 是 | 构建 ID |
JobId | Integer | 是 | 构建计划 ID |
CodingCIId | String | 是 | 构建唯一标识 |
Number | Integer | 是 | 构建序号 |
CommitId | String | 是 | Git Commit ID |
Cause | String | 是 | 触发原因 |
Branch | String | 是 | 分支 |
FailedMessage | String | 是 | 失败原因 |
JenkinsFileContent | String | 是 | 本次构建的 Jenkinsfile |
Duration | Integer | 是 | 构建执行时间 QUEUED 等待构建 INITIALIZING 初始化 NOT_BUILT 准备构建 RUNNING 运行中 SUCCEED 成功 FAILED 失败 ABORTED 被取消 TIMEOUT 超时 |
Status | String | 是 | 构建当前状态 |
StatusNode | String | 是 | 构建进行到了哪个 stage/node |
CreatedAt | Integer | 是 | 构建创建时间 |
TestResult | CIBuildTestResult | 是 | 测试结果 |
StartedAt | Integer | 否 | 开始构建时间,如果为负数就是默认值表示还未开始 注意:此字段可能返回 null,表示取不到有效值。 |
NodeObtainedAt | Integer | 否 | 获取到执行机的时间,如果为负数表示还未获取到构建节点 注意:此字段可能返回 null,表示取不到有效值。 |
EnvList | Array of CIJobEnv | 否 | 构建使用的环境变量 注意:此字段可能返回 null,表示取不到有效值。 |
Example 1
成功示例
1{
2 "Action": "DescribeCodingCIBuild",
3 "BuildId": 56
4}
成功示例
1{
2 "Response": {
3 "RequestId": "1",
4 "Build": {
5 "Id": 55,
6 "JobId": 23,
7 "CodingCIId": "cci-2-605077",
8 "Number": 2,
9 "CommitId": "14c8e6e51ea01fc916dbcaf416f79a68f42c7634",
10 "Cause": "coding 手动触发",
11 "Branch": "",
12 "FailedMessage": "",
13 "JenkinsFileContent": "pipeline {\n agent any\n stages {\n \n stage(\"检出\") {\n steps {\n checkout(\n [$class: 'GitSCM', branches: [[name: env.GIT_BUILD_REF]], \n userRemoteConfigs: [[url: env.GIT_REPO_URL, credentialsId: env.CREDENTIALS_ID]]]\n )\n }\n }\n\n stage(\"构建\") {\n steps {\n echo \"构建中...\"\n sh 'docker version'\n // 请在这里放置您项目代码的单元测试调用过程,例如:\n // sh 'mvn package' // mvn 示例\n // sh 'make' // make 示例\n echo \"构建完成.\"\n \n // 演示怎样产生构建物\n script{\n def exists = fileExists 'README.md'\n if (!exists) {\n writeFile(file: 'README.md', text: 'Helloworld')\n }\n }\n archiveArtifacts artifacts: 'README.md', fingerprint: true\n \n // archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true // 收集构建产物\n }\n }\n\n stage(\"测试\") {\n steps {\n echo \"单元测试中...\"\n // 请在这里放置您项目代码的单元测试调用过程,例如:\n // sh 'mvn test' // mvn 示例\n // sh 'make test' // make 示例\n echo \"单元测试完成.\"\n \n // 演示怎么样生成测试报告\n writeFile(file: 'TEST-demo.junit4.AppTest.xml', text: '''\n <testsuite name=\"demo.junit4.AppTest\" time=\"0.053\" tests=\"3\" errors=\"0\" skipped=\"0\" failures=\"0\">\n <properties>\n </properties>\n <testcase name=\"testApp\" classname=\"demo.junit4.AppTest\" time=\"0.003\"/>\n <testcase name=\"test1\" classname=\"demo.junit4.AppTest\" time=\"0\"/>\n <testcase name=\"test2\" classname=\"demo.junit4.AppTest\" time=\"0\"/>\n </testsuite>\n ''')\n junit '*.xml'\n \n // junit 'target/surefire-reports/*.xml' // 收集单元测试报告的调用过程\n }\n }\n\n stage(\"部署\") {\n steps {\n echo \"部署中...\"\n // 请在这里放置收集单元测试报告的调用过程,例如:\n // sh 'mvn tomcat7:deploy' // Maven tomcat7 插件示例:\n // sh './deploy.sh' // 自研部署脚本\n echo \"部署完成\"\n }\n }\n }\n}\n",
14 "Duration": 8000,
15 "Status": "SUCCEED",
16 "StatusNode": "",
17 "TestResult": {
18 "Empty": false,
19 "FailCount": 0,
20 "PassCount": 0,
21 "SkipCount": 0,
22 "TotalCount": 0,
23 "Duration": 0
24 },
25 "CreatedAt": 1589084450000
26 }
27 }
28}
获取构建计划的构建列表
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DescribeCodingCIBuilds。 |
JobId | 是 | Integer | 构建计划 ID |
PageNumber | 是 | Integer | 页码 |
PageSize | 是 | Integer | 每页条数 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Data | DescribeCodingCIBuildsData | 构建列表 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
DescribeCodingCIBuildsData
获取构建计划的构建列表
名称 | 类型 | 描述 |
---|---|---|
BuildList | Array of CodingCIBuild | 构建列表 |
PageNumber | Integer | 页码 |
TotalCount | Integer | 总条数 |
PageSize | Integer | 每页多少条 |
Example 1
成功示例
1{
2 "Action": "DescribeCodingCIBuilds",
3 "JobId": 1,
4 "PageNumber": 1,
5 "PageSize": 2
6}
成功示例
1{
2 "Response": {
3 "RequestId": "1",
4 "Data": {
5 "BuildList": [
6 {
7 "Id": 55,
8 "JobId": 23,
9 "CodingCIId": "cci-2-605077",
10 "Number": 2,
11 "CommitId": "14c8e6e51ea01fc916dbcaf416f79a68f42c7634",
12 "Cause": "coding 手动触发",
13 "Branch": "",
14 "FailedMessage": "",
15 "JenkinsFileContent": "pipeline {\n agent any\n stages {\n \n stage(\"检出\") {\n steps {\n checkout(\n [$class: 'GitSCM', branches: [[name: env.GIT_BUILD_REF]], \n userRemoteConfigs: [[url: env.GIT_REPO_URL, credentialsId: env.CREDENTIALS_ID]]]\n )\n }\n }\n\n stage(\"构建\") {\n steps {\n echo \"构建中...\"\n sh 'docker version'\n // 请在这里放置您项目代码的单元测试调用过程,例如:\n // sh 'mvn package' // mvn 示例\n // sh 'make' // make 示例\n echo \"构建完成.\"\n \n // 演示怎样产生构建物\n script{\n def exists = fileExists 'README.md'\n if (!exists) {\n writeFile(file: 'README.md', text: 'Helloworld')\n }\n }\n archiveArtifacts artifacts: 'README.md', fingerprint: true\n \n // archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true // 收集构建产物\n }\n }\n\n stage(\"测试\") {\n steps {\n echo \"单元测试中...\"\n // 请在这里放置您项目代码的单元测试调用过程,例如:\n // sh 'mvn test' // mvn 示例\n // sh 'make test' // make 示例\n echo \"单元测试完成.\"\n \n // 演示怎么样生成测试报告\n writeFile(file: 'TEST-demo.junit4.AppTest.xml', text: '''\n <testsuite name=\"demo.junit4.AppTest\" time=\"0.053\" tests=\"3\" errors=\"0\" skipped=\"0\" failures=\"0\">\n <properties>\n </properties>\n <testcase name=\"testApp\" classname=\"demo.junit4.AppTest\" time=\"0.003\"/>\n <testcase name=\"test1\" classname=\"demo.junit4.AppTest\" time=\"0\"/>\n <testcase name=\"test2\" classname=\"demo.junit4.AppTest\" time=\"0\"/>\n </testsuite>\n ''')\n junit '*.xml'\n \n // junit 'target/surefire-reports/*.xml' // 收集单元测试报告的调用过程\n }\n }\n\n stage(\"部署\") {\n steps {\n echo \"部署中...\"\n // 请在这里放置收集单元测试报告的调用过程,例如:\n // sh 'mvn tomcat7:deploy' // Maven tomcat7 插件示例:\n // sh './deploy.sh' // 自研部署脚本\n echo \"部署完成\"\n }\n }\n }\n}\n",
16 "Duration": 8000,
17 "Status": "SUCCEED",
18 "StatusNode": "",
19 "TestResult": {
20 "Empty": false,
21 "FailCount": 0,
22 "PassCount": 0,
23 "SkipCount": 0,
24 "TotalCount": 0,
25 "Duration": 0
26 },
27 "CreatedAt": 1589084450000
28 },
29 {
30 "Id": 54,
31 "JobId": 23,
32 "CciId": "cci-1-863629",
33 "Number": 1,
34 "CommitId": "14c8e6e51ea01fc916dbcaf416f79a68f42c7634",
35 "Cause": "coding 手动触发",
36 "Branch": "",
37 "FailedMessage": "",
38 "JenkinsFileContent": "pipeline {\n agent any\n stages {\n \n stage(\"检出\") {\n steps {\n checkout(\n [$class: 'GitSCM', branches: [[name: env.GIT_BUILD_REF]], \n userRemoteConfigs: [[url: env.GIT_REPO_URL, credentialsId: env.CREDENTIALS_ID]]]\n )\n }\n }\n\n stage(\"构建\") {\n steps {\n echo \"构建中...\"\n sh 'docker version'\n // 请在这里放置您项目代码的单元测试调用过程,例如:\n // sh 'mvn package' // mvn 示例\n // sh 'make' // make 示例\n echo \"构建完成.\"\n \n // 演示怎样产生构建物\n script{\n def exists = fileExists 'README.md'\n if (!exists) {\n writeFile(file: 'README.md', text: 'Helloworld')\n }\n }\n archiveArtifacts artifacts: 'README.md', fingerprint: true\n \n // archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true // 收集构建产物\n }\n }\n\n stage(\"测试\") {\n steps {\n echo \"单元测试中...\"\n // 请在这里放置您项目代码的单元测试调用过程,例如:\n // sh 'mvn test' // mvn 示例\n // sh 'make test' // make 示例\n echo \"单元测试完成.\"\n \n // 演示怎么样生成测试报告\n writeFile(file: 'TEST-demo.junit4.AppTest.xml', text: '''\n <testsuite name=\"demo.junit4.AppTest\" time=\"0.053\" tests=\"3\" errors=\"0\" skipped=\"0\" failures=\"0\">\n <properties>\n </properties>\n <testcase name=\"testApp\" classname=\"demo.junit4.AppTest\" time=\"0.003\"/>\n <testcase name=\"test1\" classname=\"demo.junit4.AppTest\" time=\"0\"/>\n <testcase name=\"test2\" classname=\"demo.junit4.AppTest\" time=\"0\"/>\n </testsuite>\n ''')\n junit '*.xml'\n \n // junit 'target/surefire-reports/*.xml' // 收集单元测试报告的调用过程\n }\n }\n\n stage(\"部署\") {\n steps {\n echo \"部署中...\"\n // 请在这里放置收集单元测试报告的调用过程,例如:\n // sh 'mvn tomcat7:deploy' // Maven tomcat7 插件示例:\n // sh './deploy.sh' // 自研部署脚本\n echo \"部署完成\"\n }\n }\n }\n}\n",
39