# 说明

更新计划范围和目标

# url

https://api.tapd.cn/api/testx/plan/v1/namespaces/{namespace}/plans/{uid}/target-scope

# 支持格式

JSON

# HTTP请求方式

PUT

# 请求数限制

一次更新一条计划

# 请求参数

# Request

字段名 必选 类型及范围 说明
Plan Plan 计划信息
CaseTesterDetails repeated CaseTesterDetail 测试人员分配详情

# Data

字段名 必选 类型及范围 说明
Meta PlanMeta 计划元信息
Spec PlanSpec 计划规格

# PlanMeta

字段名 必选 类型及范围 说明
Uid string 计划唯一标识
Namespace string 命名空间
FolderUid string 目录ID
Name string 接口库标识名
Description string 描述信息
DataSource PlanDataSource 数据源
State State 计划状态
Testers repeated string 测试人员列表
FolderPath string 所属目录绝对路径
Version Version 计划API版本
CasePath CasePath 用例存储路径
Nid string 序号
Path string 路径

# PlanSpec

字段名 类型及范围 说明
Notification Notification 通知设置
Field PlanFieldSpec 计划字段
CustomFields repeated Property 自定义属性
Stories repeated Issue 需求列表
Bugs repeated Issue 缺陷列表
Iterations repeated Issue 迭代列表
Statistic PlanStatistic 统计信息
Properties repeated Property 计划扩展属性
SystemFields repeated Property 系统字段
Scope PlanScope 计划范围
Target PlanTarget 计划目标
Versions repeated Issue 关联版本列表

# Notification

字段名 类型及范围 说明
StartAt string 开始时间
EndAt string 截止时间
TimeOption TimeOption 定时选项
TimeAddition string 定时配置(cron表达式等)
MessageTitle string 消息标题
MessageTemplate string 消息内容模板
EmailAddresses string list 邮箱通知地址
EmailCcs string list 邮箱抄送地址
WeworkGroupUsers string list 企微tips通知用户
Channel Channel list 通道配置

# TimeOption

枚举值 说明
NO_REMIND 不提醒
WHEN_CREATE 创建任务时提醒一次
TIME_TIGGER 定时提醒
INTERVAL_TIGGER 间隔提醒

# Channel

枚举值 说明
UNKNOWN 无实际意义
EMAIL 邮件提醒
WEWORK_APP 企业微信应用消息

# Issue

字段名 类型及范围 说明
IssueUid string 问题唯一标识
Namespace string 命名空间
WorkspaceUid string 工作空间ID
Type Type 问题类型
Source Source 问题来源
Detail google.protobuf.Struct 问题详情数据
IssueName string 问题名称
IsDeleted bool 是否已删除

# IssueType

枚举值 说明
UNKNOWN 未知类型
ITERATION 迭代
VERSION 版本
STORY 需求
TASK 子任务
BUG 缺陷

# IssueSource

枚举值 说明
NONE 无来源
TAPD TAPD

# PlanStatistic

字段名 类型及范围 说明
SucceedCaseCount uint32 成功用例数
FailedCaseCount uint32 失败用例数
BlockCaseCount uint32 阻塞用例数
ErrorCaseCount uint32 错误用例数
RetryCaseCount uint32 重试用例数
IgnoreCaseCount uint32 忽略用例数
TodoCaseCount uint32 未测试用例数
ManualSucceedRate string 手工用例成功率
TestedCaseCount uint32 已测试用例数
TotalCaseCount uint32 用例总数
CaseSucceedRate string 用例成功率
StoryPassedRate string 需求通过率
FailedTaskCount uint32 未通过任务数
CaseCoverageRate string 用例覆盖率
StoryCount uint32 功能需求数

# PlanFieldSpec

字段名 类型及范围 说明
Developers repeated string 开发人员列表
ProjectManagers repeated string 项目经理列表
ProductManagers repeated string 产品经理列表
Summary string 总结
Version string 版本
Type string 类型
ExtranetPublish string 外网发布
PublishReview string 发布评审
EstimateTestAt string 预计提测时间
ActualTestAt string 实际提测时间
EstimatePublishAt string 预计发布时间
ActualPublishAt string 实际发布时间
EstimateStartedAt string 测试预计开始时间
EstimateEndedAt string 测试预计完成时间
Env string 测试环境

# Property

字段名 类型及范围 说明
Name string 属性名称
Label string 显示值
Value google.protobuf.Value 实际值
Url string 超链接地址
flag string 属性标志

# PlanScope

字段名 类型及范围 说明
Stories repeated Issue 需求列表
StoryCaseStrategy StoryCaseStrategy 用例关联策略

# StoryCaseStrategy

字段名 类型及范围 说明
Mode Mode 关联模式
Priorities repeated Priority 用例优先级列表

# Priority

枚举值 说明
Unknown 未知优先级
P0 最高优先级
P1 高优先级
P2 中优先级
P3 低优先级

# StoryCaseStrategyMode

枚举值 说明
UNKNOWN 未知
ALL 关联全部用例
PATCH 按条件关联部分用例
NOT 不关联用例
SELECT_CASE 取需求用例和入参用例的交集

# PlanTarget

字段名 类型及范围 说明
Description string 目标描述
Feature string 涉及功能
Deliverables string 交付成果
SuccessConditions repeated string 通过标准

# State

枚举值 说明
NONE 无状态
WAITING 等待中
RUNNING 运行中
DONE 已完成
ARCHIVE 已归档

# Version

枚举值 说明
V1 版本1
V2 版本2

# CasePath

字段名 类型及范围 说明
RepoUid string 用例库版本ID
RepoVersionUid string 用例库版本ID
FolderUid string 父用例目录ID

# PlanDataSource

字段名 类型及范围 说明
Mode Mode 数据源模式
CaseUids repeated string 用例UID列表
CasesetUids repeated string 用例集UID列表
CaseSuiteUid string 测试套件UID

# Mode

枚举值 说明
UNKNOWN 未知模式
CASE_REPO 用例库模式
CASE_SET 用例集模式

# 入参示例

// 简单更新
{
	"Plan": {
		"Spec": {
			"Scope": {
				"Stories": [{
					"IssueUid": "issue_uid",
					"Namespace": "namespace",
					"WorkspaceUid": "workspace_uid",
					"Type": "STORY",
					"Source": "NONE",
					"IssueName": "测试需求",
					"IssueUrl": "",
					"Detail": {
						"Creator": "TAPD",
						"Id": "需求id",
						"IterationId": "迭代id",
						"NamespaceId": "",
						"Owners": "",
						"Priority": {
							"Label": "",
							"Value": ""
						},
						"Status": {
							"Label": "规划中",
							"Value": "planning"
						},
						"Summary": "测试需求",
						"WorkspaceId": "67366965"
					}
				}],
				"StoryCaseStrategy": {
					"Mode": "UNKNOWN",
					"Priorities": []
				}
			},
			"Target": {
				"Description": "{\"richHtmlValue\":\"<p>测试目标概述</p>\"}",
				"Feature": "{\"richHtmlValue\":\"<p>测试涉及功能</p>\"}",
				"Deliverables": "{\"richHtmlValue\":\"<p>测试交付产物</p>\"}",
				"SuccessConditions": ["标准一", "标准二"]
			}
		}
	}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

# 返回结果

{
    "Error": null,
    "Data": {
        "Meta": {
            "Uid": "xx",
            "Namespace": "xxx",
            "Audit": {
                "Creator": "xxx",
                "CreatedAt": "2025-07-14T14:18:56+08:00",
                "StartedAt": "",
                "EndedAt": "",
                "Starter": "",
                "Terminator": "xx",
                "UpdatedAt": "2025-07-14T14:18:56+08:00",
                "Updater": ""
            },
            "FolderUid": "xx",
            "Name": "测试",
            "Description": "",
            "DataSource": {
                "Mode": "CASE_REPO",
                "CaseUids": [],
                "CasesetUids": [],
                "CaseSuiteUid": "xx"
            },
            "State": "WAITING",
            "Testers": [],
            "FolderPath": "/test/test子目录",
            "Version": "V2",
            "CasePath": {
                "RepoUid": "",
                "RepoVersionUid": "",
                "FolderUid": ""
            },
            "Nid": "",
            "Path": ".152316.152317."
        },
        "Spec": {
            "Notification": {
                "StartAt": "",
                "ExpireAt": "2025-07-14T00:00:00+08:00",
                "TimeOption": "NO_REMIND",
                "TimeAddition": "",
                "MessageTitle": "",
                "MessageTemplate": "",
                "EmailAddresses": [],
                "EmailCcs": [],
                "SmsPhoneNumbers": [],
                "WeworkGroupUsers": [],
                "WeworkGroupIds": [],
                "WeworkGroupTitle": "",
                "Channel": [],
                "WeworkOption": "NONE",
                "WeworkGroupUid": "",
                "Enabled": false,
                "CommentEnabled": false,
                "Type": "REVIEW_NOTIFICATION"
            },
            "Field": {
                "Developers": [],
                "ProjectManagers": [],
                "ProductManagers": [],
                "Summary": "",
                "Version": "",
                "Type": "",
                "ExtranetPublish": "",
                "PublishReview": "",
                "EstimateTestAt": "",
                "ActualTestAt": "",
                "EstimatePublishAt": "",
                "ActualPublishAt": "",
                "EstimateStartedAt": "",
                "EstimateEndedAt": "",
                "Env": ""
            },
            "CustomFields": [],
            "Stories": [],
            "Bugs": [],
            "Iterations": [],
            "Statistic": {
                "SucceedCaseCount": 0,
                "FailedCaseCount": 0,
                "BlockCaseCount": 0,
                "ErrorCaseCount": 0,
                "RetryCaseCount": 0,
                "IgnoreCaseCount": 0,
                "TodoCaseCount": 0,
                "ManualSucceedRate": "",
                "TestedCaseCount": 0,
                "TotalCaseCount": 0,
                "CaseSucceedRate": "",
                "StoryPassedRate": "",
                "FailedTaskCount": 0,
                "CaseCoverageRate": "",
                "StoryCount": 0
            },
            "Properties": [],
            "SystemFields": [],
            "Scope": {
                "Stories": [],
                "StoryCaseStrategy": {
                    "Mode": "UNKNOWN",
                    "Priorities": []
                }
            },
            "Target": {
                "Description": "",
                "Feature": "",
                "Deliverables": "",
                "SuccessConditions": [
                    "",
                    ""
                ]
            },
            "Versions": [],
            "Target": {
                "Description": "{\"richHtmlValue\":\"<p>测试目标概述</p>\"}",
                "Feature": "{\"richHtmlValue\":\"<p>测试涉及功能</p>\"}",
                "Deliverables": "{\"richHtmlValue\":\"<p>测试交付产物</p>\"}",
                "SuccessConditions": [
                    "标准一",
                    "标准二"
                ]
            },
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
上次更新: 2025-07-22 14:18:47