适用版本 | 中心版、Region版 |
服务接入点与授权信息
产品 | 资源 | 所需权限 |
测试管理 | 测试计划 | 读写 |
请求语法
中心版
POST https://{domain}/oapi/v1/testhub/organizations/{organizationId}/testPlansRegion版
POST https://{domain}/oapi/v1/testhub/testPlans请求头
参数 | 类型 | 是否必填 | 描述 | 示例值 |
x-yunxiao-token | string | 是 | 个人访问令牌。 | pt-0fh3****0fbG_35af****0484 |
请求参数
参数 | 类型 | 位置 | 是否必填 | 描述 | 示例值 |
organizationId | string | path |
| organizationId。 | |
| - | object | body | 否 | ||
description | string | body | 否 | 测试计划描述。 | 回归测试计划,覆盖登录与下单核心链路 |
endDate | string | body | 否 | 结束日期,格式 yyyy-MM-dd。 | 2026-07-17 |
managerIdentifiers | array[string] | body | 是 | 测试计划负责人的用户标识列表,必填。 | ["4f8a1b2c3d4e5f6a7b8c9d0e"] |
memberIdentifiers | array[string] | body | 否 | 测试计划参与人的用户标识列表。 | ["1a2b3c4d5e6f7a8b9c0d1e2f"] |
name | string | body | 是 | 测试计划名称。 | 回归测试计划 |
projectIdentifier | string | body | 否 | 关联的项目唯一标识,可不填。 | 5f3a2b1c4d5e6f7a8b9c0d1e2f |
scope | string | body | 否 | 可见范围,public(公开)或 private(私有),默认 public,可能的值:[public private]。 | public |
sprintIdentifier | string | body | 否 | 关联的迭代唯一标识,可选;填写时必须同时提供 projectIdentifier,且迭代须属于该项目。 | 6a1b2c3d4e5f6a7b8c9d0e1f2a |
startDate | string | body | 否 | 开始日期,格式 yyyy-MM-dd。 | 2026-07-13 |
versionIdentifiers | array[string] | body | 否 | 关联的版本唯一标识列表,可多选,非必填。 | ["7b2c3d4e5f6a7b8c9d0e1f2a3b"] |
请求示例
中心版
curl -X 'POST' \
'https://{domain}/oapi/v1/testhub/organizations/{organizationId}/testPlans' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"description": "回归测试计划,覆盖登录与下单核心链路",
"endDate": "2026-07-17",
"managerIdentifiers": ["4f8a1b2c3d4e5f6a7b8c9d0e"],
"memberIdentifiers": ["1a2b3c4d5e6f7a8b9c0d1e2f"],
"name": "回归测试计划",
"projectIdentifier": "5f3a2b1c4d5e6f7a8b9c0d1e2f",
"scope": "public",
"sprintIdentifier": "6a1b2c3d4e5f6a7b8c9d0e1f2a",
"startDate": "2026-07-13",
"versionIdentifiers": ["7b2c3d4e5f6a7b8c9d0e1f2a3b"]
}'Region版
curl -X 'POST' \
'https://{domain}/oapi/v1/testhub/testPlans' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
--data '
{
"description": "回归测试计划,覆盖登录与下单核心链路",
"endDate": "2026-07-17",
"managerIdentifiers": ["4f8a1b2c3d4e5f6a7b8c9d0e"],
"memberIdentifiers": ["1a2b3c4d5e6f7a8b9c0d1e2f"],
"name": "回归测试计划",
"projectIdentifier": "5f3a2b1c4d5e6f7a8b9c0d1e2f",
"scope": "public",
"sprintIdentifier": "6a1b2c3d4e5f6a7b8c9d0e1f2a",
"startDate": "2026-07-13",
"versionIdentifiers": ["7b2c3d4e5f6a7b8c9d0e1f2a3b"]
}'返回参数
参数 | 类型 | 描述 | 示例值 |
| - | object | ||
id | string | id。 | id-xxx |
返回示例
{
"id": "id-xxx"
}错误码
访问错误码中心查看 API 相关错误码。