华为云用户手册

  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用 IAM 服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 表3 请求Body参数 参数 是否必选 参数类型 描述 date_range 否 String 统计周期 metric_type 否 String 指标类型 sprint_id 否 String 迭代ID dividend 否 dividend object 指标分子过滤条件 divisor 否 Object 指标分母过滤条件 表4 dividend 参数 是否必选 参数类型 描述 on_time 否 String 是否按时 custom_field16 否 String 自定义字段 custom_field17 否 String 自定义字段 custom_field18 否 String 自定义字段 custom_field19 否 String 自定义字段 custom_field20 否 String 自定义字段 custom_field21 否 String 自定义字段 custom_field22 否 String 自定义字段 custom_field23 否 String 自定义字段 custom_field24 否 String 自定义字段 custom_field25 否 String 自定义字段 custom_field26 否 String 自定义字段 custom_field27 否 String 自定义字段 custom_field28 否 String 自定义字段 custom_field29 否 String 自定义字段 custom_field30 否 String 自定义字段 custom_field31 否 String 自定义字段 custom_field32 否 String 自定义字段 custom_field33 否 String 自定义字段 custom_field34 否 String 自定义字段 custom_field35 否 String 自定义字段 custom_field36 否 String 自定义字段 custom_field37 否 String 自定义字段 custom_field38 否 String 自定义字段 custom_field39 否 String 自定义字段 custom_field40 否 String 自定义字段
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 user_role Integer 用户角色id 成员角色, -1 项目创建者, 3 项目经理, 4 开发人员, 5 测试经理, 6 测试人员, 7 参与者, 8 浏览者, 9 运维经理 状态码: 400 表4 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 401 表5 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码
  • 响应参数 状态码: 200 表5 响应Body参数 参数 参数类型 描述 dividend_value String 指标分子数值 divisor_value String 指标分母数值 metric_name String 指标名称 metric_value String 指标数值 project_id String 项目ID project_name String 项目名称 状态码: 400 表6 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 401 表7 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码
  • 请求示例 Post https://{endpoint}/v1/eace9c0a00574de6878ab580daa9a317/bugs-per-developer/query{ "dividend" : { "custom_field16" : "自定义字段值" }, "divisor" : { }, "metric_type" : "issues_per_developer", "sprint_id" : "8883443"}
  • 响应示例 状态码: 200 OK { "dividend_value" : 15, "divisor_value" : 20, "metric_name" : "completion_rate|bug_density|bugs_per_developer", "metric_value" : 0.8945, "project_id" : "eace9c0a00574de6878ab580daa9a317", "project_name" : "demo"}
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 表3 请求Body参数 参数 是否必选 参数类型 描述 metric_type 否 String 指标类型 sprint_id 否 String 迭代ID dividend 否 dividend object 指标分子过滤条件 divisor 否 Object 指标分母过滤条件 表4 dividend 参数 是否必选 参数类型 描述 custom_field16 否 String 自定义字段 custom_field17 否 String 自定义字段 custom_field18 否 String 自定义字段 custom_field19 否 String 自定义字段 custom_field20 否 String 自定义字段 custom_field21 否 String 自定义字段 custom_field22 否 String 自定义字段 custom_field23 否 String 自定义字段 custom_field24 否 String 自定义字段 custom_field25 否 String 自定义字段 custom_field26 否 String 自定义字段 custom_field27 否 String 自定义字段 custom_field28 否 String 自定义字段 custom_field29 否 String 自定义字段 custom_field30 否 String 自定义字段 custom_field31 否 String 自定义字段 custom_field32 否 String 自定义字段 custom_field33 否 String 自定义字段 custom_field34 否 String 自定义字段 custom_field35 否 String 自定义字段 custom_field36 否 String 自定义字段 custom_field37 否 String 自定义字段 custom_field38 否 String 自定义字段 custom_field39 否 String 自定义字段 custom_field40 否 String 自定义字段
  • 响应参数 状态码: 200 表2 响应Body参数 参数 参数类型 描述 domain_id String 租户id domain_name String 租户名 user_num_id Integer 用户数字id user_id String 用户id user_name String 用户名 nick_name String 用户昵称 created_time Long 创建时间 updated_time Long 更新时间 gender String 性别 user_type String 用户类型, User 云用户, Federation 联邦账号, 状态码: 400 表3 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 401 表4 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码
  • 响应示例 状态码: 200 OK { "domain_id" : "4e919d73499648e3b0292cd3cbef806a", "domain_name" : "demo_user_name", "user_num_id" : "4060", "user_id" : "a360371833bf4c558f796fd707b44daf", "user_name" : "demo_user_name", "nick_name" : "我的名字要非常非常长才能测出问题", "created_time" : "1562318865000", "updated_time" : "1598074854000", "gender" : "male", "user_type" : "User"}
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 表3 请求Body参数 参数 是否必选 参数类型 描述 date_range 否 String 统计周期 metric_type 否 String 指标类型 dividend 否 dividend object 指标分子过滤条件 divisor 否 Object 指标分母过滤条件 表4 dividend 参数 是否必选 参数类型 描述 custom_fields 否 Array of custom_fields objects 自定义类型过滤条件 表5 custom_fields 参数 是否必选 参数类型 描述 name 否 String 自定义字段名称 options 否 String 自定义字段取值,逗号分隔
  • 请求示例 Post https://{endpoint}/v2/eace9c0a00574de6878ab580daa9a317/bug-density/query{ "date_range" : "1590940800000,1593446400000", "dividend" : { "custom_fields" : [ { "name" : "自定义字段名称", "options" : "自定义字段值" } ] }, "divisor" : { }, "metric_type" : "bug_density"}
  • 响应参数 状态码: 200 表6 响应Body参数 参数 参数类型 描述 dividend_value String 指标分子数值 divisor_value String 指标分母数值 metric_name String 指标名称 metric_value String 指标数值 project_id String 项目ID project_name String 项目名称 状态码: 400 表7 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 401 表8 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码
  • 响应示例 状态码: 200 OK { "dividend_value" : 15, "divisor_value" : 20, "metric_name" : "completion_rate|bug_density|bugs_per_developer", "metric_value" : 0.8945, "project_id" : "eace9c0a00574de6878ab580daa9a317", "project_name" : "demo"}
  • 响应示例 状态码: 200 OK { "records" : [ { "work_item_record_id" : "7401906a85de466c81fd90e22824eb19", "work_item_id" : "4633454879781163008", "project_id" : "526cefde62004de2b62b5e8dd2c2b3af", "work_item_statuses" : [ { "id" : "7401906a85de466c81fd90e22824eb19", "status" : { "id" : "d25fe91f7f6b489db5f804e66ac3b360", "name" : "7401906a85de466c81fd90e22824eb19", "type" : "BACK LOG ", "description" : "demo", "parent_status_id" : "7401906a85de466c81fd90e22824aaaa" } } ] } ], "total" : 1}
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 records Array of WorkitemStatusRecords objects 操作历史 total Integer 总数 表5 WorkitemStatusRecords 参数 参数类型 描述 work_item_record_id String 工作项的记录id,一个工作项对应一条记录 最小长度:32 最大长度:32 work_item_id String 工作项id project_id String devcloud项目的32位id 最小长度:32 最大长度:32 work_item_statuses Array of WorkitemStatus objects 操作历史 表6 WorkitemStatus 参数 参数类型 描述 id String 工作项状态变更记录的id,每次变更产生一条新的记录id 最小长度:1 最大长度:32 status status object 工作项的状态 表7 status 参数 参数类型 描述 id String 工作项的状态id 最小长度:1 最大长度:32 name String 状态名称 最小长度:1 最大长度:60 type String 工作项状态的类型, BACKLOG( "初始化"), READY("待启动"), IN_PROGRESS("进行中"), COMPLETE("已完成"), DONE("已结束"), description String 工作项状态的描述 parent_status_id String 工作项状态的父状态id 最小长度:1 最大长度:32 状态码: 400 表8 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 401 表9 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码
  • URI GET /v4/projects/{project_id}/work-items/status-records 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String devcloud项目的32位id 最小长度:32 最大长度:32 表2 Query参数 参数 是否必选 参数类型 描述 offset 否 Integer 偏移量 从0开始 最小值:0 缺省值:0 limit 否 Integer 每页数量 最小1,最大100 最小值:1 最大值:100 缺省值:100
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 templates Array of templates objects 模板信息列表 表5 templates 参数 参数类型 描述 id Integer 模板id project_id Integer 项目id tracker_id Integer 工作项类型id description String 工作项详情模板描述内容 issue_field_config String 模板配置 状态码: 400 表6 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 401 表7 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码
  • URI GET /v4/projects/{project_id}/status-statistic 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String devcloud项目的32位id 表2 Query参数 参数 是否必选 参数类型 描述 iteration_id 是 Integer 迭代数字id tracker_id 是 Integer 自定义字段支持的工作项类型 2任务/Task,3缺陷/Bug,7Story status_id 是 Integer 工作项状态数字id
  • 响应示例 状态码: 200 OK [ { "user" : { "user_id" : "112a642015cf11eca152fa163ec9f6c1", "user_num_id" : 5055, "name" : "devcloud_devcloud_test_01_test" }, "item_count" : 1, "data" : { "5874579" : 1 }}, { "user" : { "user_id" : "1139ffb615cf11eca152fa163ec9f6c1", "user_num_id" : 5255, "name" : "devcloud_devcloud_test_01_test" }, "item_count" : 1, "data" : { "5874580" : 1 }}, { "user" : { "user_id" : "a360371833bf4c558f796fd707b44daf", "user_num_id" : 9078, "nick_name" : "sstest5", "name" : "devcloud_devcloud_test_01" }, "item_count" : 2, "data" : { "5874581" : 1, "5874584" : 1 }}, { "user" : { "user_id" : "D0XCOQMxQ9Nujj9lybk51lFEQzpdpzMc", "user_num_id" : 15437, "name" : "devcloud_devcloud_test_01_FederationUser" }, "item_count" : 1, "data" : { "5874582" : 2 }} ]
  • 请求参数 表1 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 表2 请求Body参数 参数 是否必选 参数类型 描述 project_id 否 String 项目uuid issue_ids 否 Array of strings 工作项id字符串列表
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 fails Array of strings 计算失败的工作项id,一般指未关闭的工作项 data Array of data objects 计算失败的工作项id,一般指未关闭的工作项 total_stay_time Long 停留时间求和(单位:秒) total Integer 停留时间求和的工作项个数 表4 data 参数 参数类型 描述 id String 工作项id字符串 stay_time Long 停留时间(单位:秒) 状态码: 400 表5 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 401 表6 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 work_hours_types Array of WorkHoursType objects 工时类型列表 total Integer 总数 表5 WorkHoursType 参数 参数类型 描述 id Integer 工时类型id name String 工时类型名称 status Integer 工时类型状态,1表示启用中,2表示未启用 状态码: 400 表6 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 401 表7 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码
  • 响应示例 状态码: 200 ok { "work_hours_types" : [ { "id" : 21, "name" : "研发设计", "status" : 1 }, { "id" : 22, "name" : "后端开发", "status" : 1 }, { "id" : 23, "name" : "前端开发(Web)", "status" : 1 }, { "id" : 24, "name" : "前端开发(小程序)", "status" : 1 }, { "id" : 25, "name" : "前端开发(App)", "status" : 1 }, { "id" : 26, "name" : "测试验证", "status" : 1 }, { "id" : 27, "name" : "缺陷修复", "status" : 1 } ], "total" : 7}
  • URI GET /v4/projects/{project_id}/work-hours-type 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目id 表2 Query参数 参数 是否必选 参数类型 描述 limit 否 Integer 每页显示的数量,默认显示10条,最多显示100条 最小值:1 最大值:100 缺省值:10 offset 否 Integer 分页索引,偏移量offset是limit的整数倍,limit=10,offset=0,10,20... 最小值:0 缺省值:0 status 否 Integer 工时类型状态,支持按状态筛选查询,置空时查询所有工时类型,1表示查询启用的工时类型,2表示查询未启用的工时类型
  • 响应示例 状态码: 200 OK { "issues" : [ { "actual_work_hours" : 0, "assigned_cc_user" : [ { "id" : 4091, "name" : "demo_user_name", "nick_name" : "张三" } ], "assigned_user" : { "id" : 4091, "name" : "demo_user_name", "nick_name" : "张三" }, "begin_time" : "2020-09-12", "created_time" : "2020-09-13 14:40:11", "creator" : { "id" : 4091, "name" : "demo_user_name", "nick_name" : "张三" }, "custom_fields" : [ { "name" : "customField16", "value" : "多选框", "new_name" : "custom_field16" } ], "new_custom_fields" : [ { "custom_field" : "custom_field16", "field_name" : "field_name", "value" : "多选框1,多选框2" } ], "developer" : { "id" : 4091, "name" : "demo_user_name", "nick_name" : "张三" }, "domain" : { "id" : 14, "name" : "性能" }, "done_ratio" : 0, "end_time" : "2020-09-19", "expected_work_hours" : 9, "id" : 4567, "project" : { "project_id" : "526cefde62004de2b62b5e8dd2c2b3af", "project_name" : "testDemo", "project_num_id" : 78953 }, "iteration" : { "id" : 456, "name" : "迭代1" }, "module" : { "id" : 456, "name" : "Project" }, "name" : "国际化整改", "parent_issue" : { "id" : 123, "name" : "提供查询项目成员的功能" }, "priority" : { "id" : 1, "name" : "低" }, "severity" : { "id" : 12, "name" : "一般" }, "status" : { "id" : 1, "name" : "新建" }, "tracker" : { "id" : 7, "name" : "story" }, "updated_time" : "2020-09-14 14:40:11", "closed_time" : "2020-09-15 14:40:11", "deleted" : false } ], "total" : 1}
  • 响应参数 状态码: 200 表5 响应Body参数 参数 参数类型 描述 issues Array of ListIssueItemResponse objects 工作项列表 total Integer 总数 表6 ListIssueItemResponse 参数 参数类型 描述 actual_work_hours Double 实际工时 assigned_cc_user Array of IssueUser objects 抄送人 assigned_user IssueUser object begin_time String 预计开始时间,年-月-日 created_time String 创建时间 年-月-日 时:分:秒 creator IssueUser object custom_fields Array of CustomField objects 自定义属性值,不建议使用,建议参考new_custom_fields字段 new_custom_fields Array of NewCustomField objects 自定义属性值 developer IssueUser object domain domain object id, 领域 14, '性能', 15, '功能', 16, '可靠性' 17, '网络安全' 18, '可维护性' 19, '其他DFX' 20, '可用性' done_ratio Integer 工作项进度值 end_time String 预计结束时间,年-月-日 expected_work_hours Double 预计工时 id Integer 工作项项id project IssueProjectResponseV4 object 项目信息 iteration iteration object 迭代 module module object 模块 name String 标题 parent_issue parent_issue object 父工作项 priority priority object 工作项优先级 severity severity object 工作项重要程度 status status object 工作项状态 tracker tracker object 工作项类型 2任务/Task,3缺陷/Bug,5Epic,6Feature,7Story updated_time String 更新时间 年-月-日 时:分:秒 closed_time String 关闭时间 年-月-日 时:分:秒 deleted Boolean 是否已经删除,true 已经删除, false 未删除 表7 IssueUser 参数 参数类型 描述 user_id String 用户uuid user_num_id Integer 用户数字id id Integer 用户id name String 用户名 nick_name String 昵称 表8 CustomField 参数 参数类型 描述 name String 自定义属性名 value String 自定义属性对应的值 new_name String 自定义属性名 表9 NewCustomField 参数 参数类型 描述 custom_field String 自定义字段 field_name String 自定义字段名称 value String 自定义属性对应的值,多个值以英文逗号区分开 表10 domain 参数 参数类型 描述 id Integer 领域id name String 领域 表11 IssueProjectResponseV4 参数 参数类型 描述 project_id String 项目id project_name String 项目名称 project_num_id Integer 项目数字id 表12 iteration 参数 参数类型 描述 id Integer 迭代id name String 迭代名 表13 module 参数 参数类型 描述 id Integer 模块id name String 模块 表14 parent_issue 参数 参数类型 描述 id Integer 父工作项id name String 父工作项 表15 priority 参数 参数类型 描述 id Integer 优先级id name String 优先级 表16 severity 参数 参数类型 描述 id Integer 重要程度id name String 重要程度 表17 status 参数 参数类型 描述 id Integer 状态id name String 状态名称 表18 tracker 参数 参数类型 描述 id Integer 类型id name String 类型名称 状态码: 400 表19 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 401 表20 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 最小长度:10 最大长度:32768 表3 请求Body参数 参数 是否必选 参数类型 描述 assigned_ids 否 Array of integers 处理人id creator_ids 否 Array of integers 创建者id developer_ids 否 Array of integers 开发人id,对应用户信息的数字id domain_ids 否 Array of integers id, 领域, 14 '性能', 15 '功能', 16 '可靠性', 17 '网络安全', 18 '可维护性', 19 '其他DFX', 20 '可用性', done_ratios 否 Array of integers 完成度 iteration_ids 否 Array of integers 迭代id limit 否 Integer 每页显示数量 最小值:1 最大值:100 offset 否 Integer 分页索引,偏移量,offset是limit的整数倍数,limit=10,offset=0,10,20... 最小值:0 module_ids 否 Array of integers 模块id priority_ids 否 Array of integers 优先级 query_type 否 String 查询类型 backlog feature epic severity_ids 否 Array of integers 查询类型 status_ids 否 Array of integers 状态 id, 新建 1, 进行中 2, 已解决 3, 测试中 4, 已关闭 5, 已拒绝 6, story_point_ids 否 Array of integers 故事点id tracker_ids 否 Array of integers 工作项类型,2任务/Task,3缺陷/Bug,5Epic,6Feature,7Story include_deleted 否 Boolean true 查询的工作项包含已经逻辑删除的,false 查询的工作项不包含已经删除的 created_time_interval 否 String 根据工作项的创建时间查询工作项,(查询的起始时间,查询的结束时间) updated_time_interval 否 String 根据工作项的更新时间查询工作项,(查询的起始时间,查询的结束时间) closed_time_interval 否 String 根据工作项的结束时间查询工作项,(查询的起始时间,查询的结束时间) custom_fields 否 Array of custom_fields objects 自定义字段 表4 custom_fields 参数 是否必选 参数类型 描述 custom_field 否 String 自定义属性字段 value 否 String 自定义属性对应的值
  • 请求参数 表1 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 最小长度:10 最大长度:32768 表2 请求Body参数 参数 是否必选 参数类型 描述 project_ids 否 Array of strings 查询的项目id列表 user_ids 否 Array of strings 查询的用户id列表 work_hours_types 否 String 工时类型,以逗号分隔,21:研发设计,22:后端开发,23:前端开发(Web),24:前端开发(小程序),25:前端开发(App),26:测试验证,27:缺陷修复,28:UI设计,29:会议,30:公共事务,31:培训,32:研究,33:其它,34:调休请假 work_hours_dates 否 String 工时日期,以逗号分隔,年-月-日 begin_time 否 String 工时开始日期,年-月-日 end_time 否 String 工时结束日期,年-月-日 offset 是 Integer 偏移量,offset是limit的整数倍,limit=10,offset=0,10,20... 最小值:0 limit 是 Integer 每页显示数量,每页最多显示100条 最小值:1 最大值:100
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 work_hours Array of work_hours objects 工时列表 total Integer 总数 表4 work_hours 参数 参数类型 描述 project_name String 项目名称 nick_name String 用户昵称 user_id String 用户id user_name String 用户名 work_date String 工时日期 work_hours_num String 工时花费 summary String 工时内容 work_hours_type_name String 工时类型 issue_id Integer 工作项id issue_type String 工作项类型 subject String 工作项标题 created_time String 工作项创建时间 closed_time String 工作项结束时间 work_hours_created_time String 工时创建时间 work_hours_updated_time String 工时更新时间 状态码: 400 表5 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 401 表6 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码
  • 请求示例 Post https://{endpoint}/v4/projects/work-hours{ "limit" : 1, "offset" : 0, "end_time" : "2020-08-14", "project_ids" : [ "e2da96a5d2c845e284f0ad47f8ca8cb2", "a2da96a5d2c845e284f0ad47f8ca8cef" ]}
  • 响应示例 状态码: 200 ok { "work_hours" : [ { "project_name" : "项目名称", "nick_name" : "用户昵称", "user_id" : "09d75cdd9a00d44d2f17c01875483f26", "user_name" : "用户名", "work_date" : "2020-02-19", "work_hours_num" : "2.0", "summary" : "做了XXXXX", "work_hours_type_name" : "后端开发", "issue_id" : 123456, "issue_type" : "Story", "subject" : "工作项标题", "created_time" : "2019-12-17", "closed_time" : "2019-12-20", "work_hours_created_time" : "2019-12-17 09:00:00", "work_hours_updated_time" : "2019-12-20 15:00:00" } ], "total" : 1}
共100000条