更新时间:2025-07-24 GMT+08:00
分享

查询被迭代引用的用例

功能介绍

查询被迭代引用的用例

调用方法

请参见如何调用API

URI

POST /v4/{project_id}/iterators/{iterator_uri}/testcases/batch-query

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目UUID,项目唯一标识,固定长度32位字符(字母和数字)。获取方式请参见获取项目ID

iterator_uri

String

迭代uri

请求参数

表2 请求Body参数

参数

是否必选

参数类型

描述

case_ids

Array of strings

用例id

响应参数

状态码:200

表3 响应Body参数

参数

参数类型

描述

status

String

success|error

result

ResultValueListTestCaseVo object

请求返回的数据

error

ApiError object

错误信息

request_id

String

由接口调用方传入,建议使用UUID保证请求的唯一性。

server_address

String

本次请求的受理的服务地址

表4 ResultValueListTestCaseVo

参数

参数类型

描述

total

Integer

参数解释

符合条件的所有记录数

取值范围

不涉及

value

Array of TestCaseVo objects

参数解释

用例数据

取值范围

不涉及

reason

String

参数解释

错误信息

取值范围

不涉及

page_size

Integer

参数解释

每页展示条数

取值范围

不涉及

page_no

Integer

参数解释

页码

取值范围

不涉及

has_more

Boolean

参数解释

是否有更多

取值范围

true:是 false:否

表5 TestCaseVo

参数

参数类型

描述

uri

String

参数解释

资源URI

取值范围

不涉及

type

String

参数解释

资源类型

取值范围

不涉及

author

String

参数解释

创建人

取值范围

不涉及

name

String

参数解释

名称

取值范围

不涉及

rank

Integer

参数解释

级别

取值范围

不涉及

preparation

String

参数解释

前置条件

取值范围

不涉及

remark

String

参数解释

备注

取值范围

不涉及

stage

String

参数解释

测试阶段

取值范围

不涉及

activity

String

参数解释

测试类型

取值范围

不涉及

keywords

String

参数解释

关键词

取值范围

不涉及

market

String

参数解释

apitest标记是否代码已提交

取值范围

不涉及

designer

String

参数解释

设计者

取值范围

不涉及

tags

String

参数解释

标签

取值范围

不涉及

execute_parameter

String

参数解释

执行参数

取值范围

不涉及

region

String

参数解释

逻辑region

取值范围

不涉及

owner

String

参数解释

处理人id,IteratorTestCase字段

取值范围

不涉及

last_modifier

String

参数解释

最后修改人

取值范围

不涉及

last_modified

String

参数解释

最后修改时间

取值范围

不涉及

last_modified_timestamp

Long

参数解释

修改时间时间戳

取值范围

不涉及

last_change_time

String

参数解释

最后变更时间

取值范围

不涉及

version_uri

String

参数解释

版本URI

取值范围

不涉及

origin_uri

String

参数解释

源资源URI

取值范围

不涉及

parent_uri

String

参数解释

父资源URI

取值范围

不涉及

parent_path

String

参数解释

父资源路径

取值范围

不涉及

creation_version_uri

String

参数解释

创建版本URI

取值范围

不涉及

creation_date

String

参数解释

创建时间

取值范围

不涉及

creation_date_timestamp

Long

参数解释

创建时间时间戳

取值范围

不涉及

author_name

String

参数解释

创建人名称

取值范围

不涉及

comment

String

参数解释

备注

取值范围

不涉及

number

String

参数解释

编号

取值范围

不涉及

case_type

Integer

参数解释

父资源路径

取值范围

不涉及用例类型

platform_type

Integer

参数解释

执行平台类型

取值范围

不涉及

service_type

Integer

参数解释

服务类型

取值范围

不涉及

service_type_name

String

参数解释

服务类型名称

取值范围

不涉及

test_type

Integer

参数解释

测试类型

取值范围

不涉及

test_type_name

String

参数解释

测试类型名称

取值范围

不涉及

design_note

String

参数解释

设计描述

取值范围

不涉及

test_step

String

参数解释

测试步骤

取值范围

不涉及

expect_output

String

参数解释

期望结果

取值范围

不涉及

env_type

String

参数解释

测试环境类型

取值范围

不涉及

exe_platform

String

参数解释

执行平台

取值范围

不涉及

testcase_project

String

参数解释

测试工程

取值范围

不涉及

svn_script_path

String

参数解释

脚本路径

取值范围

不涉及

map_restrict

String

参数解释

约束条件

取值范围

不涉及

network_script_name

String

参数解释

网络脚本名

取值范围

不涉及

auto_type

Integer

参数解释

自动化类型

取值范围

非自动化:0, 是自动化:1

to_be_auto_exec

Integer

参数解释

被自动化执行

取值范围

不涉及

last_result

String

参数解释

最后一次结果

取值范围

不涉及

last_result_uri

String

参数解释

最后一次结果Uri

取值范围

不涉及

feature_uri

String

参数解释

目录Uri

取值范围

不涉及

feature_name

String

参数解释

目录名称

取值范围

不涉及

interface_name

String

参数解释

测试接口名

取值范围

不涉及

snp_no

String

参数解释

网络问题ID

取值范围

不涉及

dr_relation_id

String

参数解释

关联需求编号

取值范围

不涉及

issue_name

String

参数解释

需求名称

取值范围

不涉及

test_base_num

String

参数解释

测试基数

取值范围

不涉及

automatically_executed

Integer

参数解释

是否被自动化执行

取值范围

不涉及

first_execute_time

String

参数解释

第一次执行时间

取值范围

不涉及

detect_type

String

参数解释

检测类型

取值范围

不涉及

execute_param

String

参数解释

执行参数

取值范围

不涉及

test_feature

String

参数解释

分析领域

取值范围

不涉及

is_contract_testcase

Integer

参数解释

是否是契约用例

取值范围

0:表示非契约用例, 1:表示契约用例

time_cost

Double

参数解释

总共耗时

取值范围

不涉及

be_auto_type_time

String

参数解释

记录用例由非自动化变为自动化类型的时间

取值范围

不涉及

compare_number

String

参数解释

配对用例编号

取值范围

不涉及

scene_flag

String

参数解释

场景标识

取值范围

不涉及

base_flag

String

参数解释

场景标识

取值范围

不涉及

para_validator

String

参数解释

区别是否从yaml中生成的用例

取值范围

默认false

knet_node_id

String

参数解释

knet节点id

取值范围

不涉及

last_exe_author

String

参数解释

最后一次执行用户

取值范围

不涉及

cloud_carrier

String

参数解释

运营商

取值范围

不涉及

market_place

String

参数解释

应用市场

取值范围

不涉及

test_mind_id

String

参数解释

脑图id

取值范围

不涉及

test_mind_url

String

参数解释

脑图url

取值范围

不涉及

commit_url

String

参数解释

git提交url

取值范围

不涉及

test_pattern_number

String

参数解释

测试模式编号

取值范围

不涉及

test_factor_number

String

参数解释

测试因子编号

取值范围

不涉及

status_code

String

参数解释

状态Code

取值范围

不涉及

result_code

String

参数解释

结果Code

取值范围

不涉及

release_id

String

参数解释

迭代ID

取值范围

不涉及

label_id

String

参数解释

标签ID

取值范围

不涉及

labels

String

参数解释

用例标签名称列表

取值范围

不涉及

module_id

String

参数解释

模块ID

取值范围

不涉及

module_name

String

参数解释

模块名称

取值范围

不涉及

module_path

String

参数解释

模块path

取值范围

不涉及

module_path_name

String

参数解释

模块路径名称

取值范围

不涉及

execute_latest_time

String

参数解释

最后执行时间

取值范围

不涉及

execute_duration

String

参数解释

执行时长

取值范围

不涉及

execute_times

Integer

参数解释

执行次数

取值范围

不涉及

is_keyword

Integer

参数解释

是否关键用例

取值范围

不涉及

release_dev

String

参数解释

测试版本号

取值范围

不涉及

new_created

String

参数解释

是否用户新增用例

取值范围

不涉及

project_uuid

String

参数解释

项目UUID,项目唯一标识,固定长度32位字符(字母和数字)。获取方式请参见获取项目ID

取值范围

长度等于32位,包含大小写字母、数字

creation_version_name

String

参数解释

创建版本名称,原逻辑marshall添加字段

取值范围

不涉及

feature_path

String

参数解释

特性路径,原逻辑marshall添加字段

取值范围

不涉及

testcase_uri

String

参数解释

实体用例Uri,IteratorTestCase字段

取值范围

不涉及

owner_name

String

参数解释

处理人名称

取值范围

不涉及

iterator_case_uri

String

参数解释

迭代用例Uri,IteratorTestCase字段

取值范围

不涉及

script_link

String

参数解释

脚本链接scriptLink

取值范围

不涉及

test_step_model

String

参数解释

测试步骤模式

取值范围

text: 文本模式; table: 表格模式

custom_field_1

String

参数解释

自定义字段1

取值范围

不涉及

custom_field_2

String

参数解释

自定义字段2

取值范围

不涉及

custom_field_3

String

参数解释

自定义字段3

取值范围

不涉及

custom_field_4

String

参数解释

自定义字段4

取值范围

不涉及

custom_field_5

String

参数解释

自定义字段5

取值范围

不涉及

custom_field_6

String

参数解释

自定义字段6

取值范围

不涉及

custom_field_7

String

参数解释

自定义字段7

取值范围

不涉及

custom_field_8

String

参数解释

自定义字段8

取值范围

不涉及

custom_field_9

String

参数解释

自定义字段9

取值范围

不涉及

custom_field_10

String

参数解释

自定义字段10

取值范围

不涉及

custom_field_11

String

参数解释

自定义字段11

取值范围

不涉及

custom_field_12

String

参数解释

自定义字段12

取值范围

不涉及

custom_field_13

String

参数解释

自定义字段13

取值范围

不涉及

custom_field_14

String

参数解释

自定义字段14

取值范围

不涉及

custom_field_15

String

参数解释

自定义字段15

取值范围

不涉及

custom_field_16

String

参数解释

自定义字段16

取值范围

不涉及

custom_field_17

String

参数解释

自定义字段17

取值范围

不涉及

custom_field_18

String

参数解释

自定义字段18

取值范围

不涉及

custom_field_19

String

参数解释

自定义字段19

取值范围

不涉及

custom_field_20

String

参数解释

自定义字段20

取值范围

不涉及

custom_field_21

String

参数解释

自定义字段21

取值范围

不涉及

custom_field_22

String

参数解释

自定义字段22

取值范围

不涉及

custom_field_23

String

参数解释

自定义字段23

取值范围

不涉及

custom_field_24

String

参数解释

自定义字段24

取值范围

不涉及

custom_field_25

String

参数解释

自定义字段26

取值范围

不涉及

表6 ApiError

参数

参数类型

描述

code

String

参数解释:

业务失败的错误码

取值范围:

不涉及

reason

String

参数解释:

业务失败的提示内容

取值范围:

不涉及

状态码:400

表7 响应Body参数

参数

参数类型

描述

error_code

String

参数解释:

接口调用失败错误码

取值范围:

不涉及

error_msg

String

参数解释:

接口调用失败错误信息

取值范围:

不涉及

状态码:401

表8 响应Body参数

参数

参数类型

描述

error_code

String

参数解释:

接口调用失败错误码

取值范围:

不涉及

error_msg

String

参数解释:

接口调用失败错误信息

取值范围:

不涉及

状态码:404

表9 响应Body参数

参数

参数类型

描述

error_code

String

参数解释:

接口调用失败错误码

取值范围:

不涉及

error_msg

String

参数解释:

接口调用失败错误信息

取值范围:

不涉及

状态码:500

表10 响应Body参数

参数

参数类型

描述

error_code

String

参数解释:

接口调用失败错误码

取值范围:

不涉及

error_msg

String

参数解释:

接口调用失败错误信息

取值范围:

不涉及

请求示例

post https://{endpoint}/v4/{project_id}/iterators/{iterator_uri}/testcases/batch-query

{
  "case_ids" : [ "001rv8jtamo1" ]
}

响应示例

状态码:200

OK

{
  "status" : "success",
  "result" : {
    "total" : 1,
    "value" : [ {
      "uri" : "001s16gt6q5",
      "type" : "TestVersion",
      "author" : "efdb403066474ab08836b9eeaaa23bca",
      "name" : "名称",
      "rank" : 1,
      "preparation" : "拥有测试权限",
      "remark" : "3",
      "stage" : "3",
      "activity" : "1",
      "keywords" : "用例",
      "market" : "1",
      "designer" : "张三",
      "tags" : "aa,bb",
      "execute_parameter" : "{a:123,b:456,c:'edit'}",
      "region" : "cn-north-7",
      "owner" : "张三",
      "last_modifier" : "efdb403066474ab08836b9eeaaa23bca",
      "last_modified" : "2025-06-19T09:35:17.006Z",
      "last_modified_timestamp" : 1660617231016,
      "last_change_time" : "2025-06-19T09:35:17.006Z",
      "version_uri" : "001s16gt68e",
      "origin_uri" : "001rv5i9u14",
      "parent_uri" : "001s16gt68e",
      "parent_path" : "/b6c4288728234a2e804b6df9465d7b5b/001s16gt68e",
      "creation_version_uri" : "001s16gt68e",
      "creation_date" : "2025-06-19T09:35:17.006Z",
      "creation_date_timestamp" : 1660617231016,
      "author_name" : "tester",
      "comment" : "备注",
      "number" : "编号",
      "case_type" : 0,
      "platform_type" : 0,
      "service_type" : 0,
      "service_type_name" : "手工测试",
      "test_type" : 1,
      "test_type_name" : "功能性测试",
      "design_note" : "市场",
      "test_step" : "1、点击自动化测试",
      "expect_output" : "用例结果为pass",
      "env_type" : "TestAPI_h8eXDPryNiOsEBGvSG32",
      "exe_platform" : "apitest",
      "testcase_project" : "1",
      "svn_script_path" : "ApiTest/Test(API)_Alpha/src/scripts/user/script.java",
      "map_restrict" : "api",
      "network_script_name" : "scripts.runs.CheckTestHomePage.java",
      "auto_type" : 1,
      "to_be_auto_exec" : 0,
      "last_result" : "Unavailable",
      "last_result_uri" : "001snptba6m1",
      "feature_uri" : "004sobn0n0t1",
      "feature_name" : "AAAA",
      "interface_name" : "DtsInfoByNoPOST",
      "snp_no" : "DTS999999AAAA9999",
      "dr_relation_id" : "20830062657;20830062217;DTS999999AAAA9999",
      "issue_name" : "需求",
      "test_base_num" : "12",
      "automatically_executed" : 1,
      "first_execute_time" : "2025-06-19T09:35:17.006Z",
      "detect_type" : "15",
      "execute_param" : "6",
      "test_feature" : "市场",
      "is_contract_testcase" : 1,
      "time_cost" : 5000,
      "be_auto_type_time" : "2025-06-19T09:35:17.006Z",
      "compare_number" : "api",
      "scene_flag" : "Debugging Case",
      "base_flag" : "true",
      "para_validator" : "true",
      "knet_node_id" : "id",
      "last_exe_author" : "李四",
      "cloud_carrier" : "市场",
      "market_place" : "marketplace",
      "test_mind_id" : "402882e172c12ee60172c1b4642900c99",
      "test_mind_url" : "string",
      "commit_url" : "string",
      "test_pattern_number" : "402882e",
      "test_factor_number" : "4sfsd82e",
      "status_code" : "4sfsd82e",
      "result_code" : "4sfsd82e",
      "release_id" : "9374510",
      "label_id" : "46a5dbfd770f445da87b1a50ee37a86b",
      "labels" : "46a5dbfd770f445da87b1a50ee37a86b",
      "module_id" : "60ace553eaf7c955f8cf1615",
      "module_name" : "模块名称",
      "module_path" : "id1/id2",
      "module_path_name" : "模块1/模块2",
      "execute_latest_time" : "2025-06-19T09:35:17.006Z",
      "execute_duration" : "00:00:09",
      "execute_times" : 46,
      "is_keyword" : 1,
      "release_dev" : "fd89a8d9dce64c54ade3d7fc9d6cd2dd",
      "new_created" : "1",
      "project_uuid" : "0000dbab7df44231a72bfa25a1259c73",
      "creation_version_name" : "111111",
      "feature_path" : "/00qs9tk745m/00qs9tlpv6r/00ssqnpuji0/",
      "testcase_uri" : "00ssqnpuji0",
      "owner_name" : "张三",
      "iterator_case_uri" : "00qs9tlpv6r",
      "script_link" : "链接",
      "test_step_model" : "text",
      "custom_field_1" : "自定义字段1",
      "custom_field_2" : "自定义字段2",
      "custom_field_3" : "自定义字段3",
      "custom_field_4" : "自定义字段4",
      "custom_field_5" : "自定义字段5",
      "custom_field_6" : "自定义字段6",
      "custom_field_7" : "自定义字段7",
      "custom_field_8" : "自定义字段8",
      "custom_field_9" : "自定义字段9",
      "custom_field_10" : "自定义字段10",
      "custom_field_11" : "自定义字段11",
      "custom_field_12" : "自定义字段12",
      "custom_field_13" : "自定义字段13",
      "custom_field_14" : "自定义字段14",
      "custom_field_15" : "自定义字段15",
      "custom_field_16" : "自定义字段16",
      "custom_field_17" : "自定义字段17",
      "custom_field_18" : "自定义字段18",
      "custom_field_19" : "自定义字段19",
      "custom_field_20" : "自定义字段20",
      "custom_field_21" : "自定义字段21",
      "custom_field_22" : "自定义字段22",
      "custom_field_23" : "自定义字段23",
      "custom_field_24" : "自定义字段24",
      "custom_field_25" : "自定义字段25"
    } ]
  },
  "error" : { },
  "request_id" : "11312as22",
  "server_address" : "10.10.10.222"
}

状态码

状态码

描述

200

OK

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

错误码

请参见错误码

相关文档