
# 查询用例列表URI接口 - QueryTiccTestCasesUris
#### 功能介绍
此接口用于根据查询条件查询符合条件的用例URI集合
#### 调用方法
请参见[如何调用API](https://support.huaweicloud.com/api-testman/cloudtest_03_2000.html)。
#### URI
POST /v4/testcase/search/used-for-automation
#### 请求参数
表1请求Body参数 
| 参数                     | 是否必选 | 参数类型                                                                                             | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
|:---|:---|:---|:---|
| keyword                | 否    | String                                                                                           | 关键字查询，用例名或编号                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| exeplatforms           | 否    | Array of strings                                                                                 | 执行平台                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| own                    | 否    | Boolean                                                                                          | 是否是我的                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| conditions             | 否    | Array of [SearchCondition] objects             | 搜索条件                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| queryByDisplayCfg      | 否    | Boolean                                                                                          | 是否表头配置查询                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| useOffset              | 否    | Boolean                                                                                          | 使用offset分页                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| project_uuid           | 是    | String                                                                                           | 项目UUID，项目唯一标识，固定长度32位字符（字母和数字）。获取方式请参见[获取项目ID](https://support.huaweicloud.com/api-testman/cloudtest_03_4003.html)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| version_uri            | 否    | String                                                                                           | 版本URI                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| case_uris              | 否    | Array of strings                                                                                 | 用例URI集合                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| owner_ids              | 否    | Array of strings                                                                                 | 处理者ID集合                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| status_codes           | 否    | Array of strings                                                                                 | 状态Code集合                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| rank_ids               | 否    | Array of strings                                                                                 | 用例等级ID集合                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| module_ids             | 否    | Array of strings                                                                                 | 模块ID集合                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| issue_id               | 否    | String                                                                                           | 需求编号                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| creator_ids            | 否    | Array of strings                                                                                 | 创建者ID集合                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| result_codes           | 否    | Array of strings                                                                                 | 结果Code集合                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| iteration_ids          | 否    | Array of strings                                                                                 | 归属迭代ID集合                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| create_start_time      | 否    | String                                                                                           | 创建开始时间                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| create_end_time        | 否    | String                                                                                           | 创建结束时间                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| associated_issue       | 否    | Boolean                                                                                          | 是否关联需求（null：不限，false：未关联，true：已关联）                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| associated_defects     | 否    | Boolean                                                                                          | 是否关联缺陷（null：不限，false：未关联，true：已关联）                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| include_sub_issue      | 否    | Boolean                                                                                          | 是否查询子需求关联的用例，默认true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| include_sub_feature    | 否    | Boolean                                                                                          | 是否查询子目录的用例，默认true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| label_ids              | 否    | Array of strings                                                                                 | 标签ID集合                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| execute_start_time     | 否    | String                                                                                           | 执行开始时间                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| execute_end_time       | 否    | String                                                                                           | 执行结束时间                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| executor_ids           | 否    | Array of strings                                                                                 | 执行者ID集合                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| test_types             | 否    | Array of strings                                                                                 | 类型                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| is_keyword             | 否    | Boolean                                                                                          | 是否组合关键字                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| issue_tree_search      | 否    | Boolean                                                                                          | 是否是需求树点击的查询关联用例                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| service_type           | 否    | Integer                                                                                          | **参数解释**: 服务类型 **约束限制**: 不涉及 **取值范围**: - -1，全量用例。   - 0，手工测试。   - 1，接口自动化。   - 7，功能自动化。   - 8，WebUI自动化。   - 100，自定义自动化(工厂)。   - 11，性能自动化。    **默认取值**: 不涉及 |
| service_types          | 否    | Array of integers                                                                                | 服务类型集合                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| stage_type             | 否    | Integer                                                                                          | 阶段过程（2：测试设计，3：测试执行，4：质量报告）                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| feature_uri            | 否    | String                                                                                           | 目录URI                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| sort_field             | 否    | String                                                                                           | 排序字段                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| sort_type              | 否    | String                                                                                           | **参数解释**: 排序方式 **约束限制**: 不涉及 **取值范围**: - ASC，升序。   - DESC，降序。    **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| page_no                | 否    | Integer                                                                                          | 当前页数                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| page_size              | 否    | Integer                                                                                          | 每页条数                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| case_type              | 否    | Integer                                                                                          | **参数解释**: 用例类型 **约束限制**: 不涉及 **取值范围**: - 0，手工测试。   - 1，接口自动化。   - 2，性能用例。    **默认取值**: 不涉及                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| custom_field_info      | 否    | Array of [QueryCustomFieldsInfo] objects | 用例自定义字段信息                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| task_uri               | 否    | String                                                                                           | 测试套uri                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| associate_issue_detail | 否    | Boolean                                                                                          | 是否返回需求具体信息（返回需求名称，需求id）                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| not_assign_task        | 否    | Boolean                                                                                          | 该字段为false,则查询全量用例，为true表示查询未分配测试套的用例                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| test_designs           | 否    | Array of booleans                                                                                | 是否来自测试设计（null或者\[true, false\]：不限，\[true\]：来自测试设计，\[false\]：否来自测试设计）                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| review_status          | 否    | Integer                                                                                          | **参数解释**: 用例评审状态 **取值范围**: - 0，未评审。   - 1，已评审。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| just_return_id         | 否    | Boolean                                                                                          | 部分字段是否仅返回ID，默认为false，为true时部分字段仅返回ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| iterator_uri_condition | 否    | String                                                                                           | 迭代uri搜索条件                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
   
 表2SearchCondition 
| 参数          | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
|:---|:---|:---|:---|
| field_name  | 否    | String | 字段名                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| field_value | 否    | String | 字段值                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| operator    | 否    | String | 数据库字段操作                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| sour_value  | 否    | String | 源值                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| tar_value   | 否    | String | 目标值                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| field_type  | 否    | String | **参数解释**: 字段类型 **约束限制**: 不涉及 **取值范围**: - richText，富文本。   - text，单行文本。   - textArea，多行文本。   - radio，单选框。   - checkBox，多选框。   - date，日期时间。   - onlyDate，日期。   - date，日期时间。   - number，数字（整数）。   - double，数字（小数）。   - checkBoxUser，多选用户。   - user，单选用户。    **默认取值**: 不涉及 |
   
 表3QueryCustomFieldsInfo 
| 参数         | 是否必选 | 参数类型             | 描述                                                                                                                                                                                                                                                                                                                                                                            |
|:---|:---|:---|:---|
| id         | 否    | Integer          | **参数解释**: 测试用例自定义字段Id **约束限制**: 不涉及 **取值范围**: 不涉及 **默认取值**: 不涉及         |
| values     | 否    | Array of strings | **参数解释**: 测试用例自定义字段值 **约束限制**: 不涉及 **取值范围**: 不涉及 **默认取值**: 不涉及          |
| field_name | 否    | String           | **参数解释**: 自定义字段名 **约束限制**: 不涉及 **取值范围**: 优先取id再取fieldName **默认取值**: 不涉及 |
   
#### 响应参数
**状态码：200**
表4响应Body参数 
| 参数    | 参数类型             | 描述      |
|:---|:---|:---|
| value | Array of strings | 请求返回的数据 |
   
#### 请求示例
```
post https://{endpoint}/v4/testcase/search/used-for-automation
{
  "keyword" : "用例名",
  "exeplatforms" : [ "string" ],
  "own" : true,
  "conditions" : [ { } ],
  "queryByDisplayCfg" : true,
  "useOffset" : true,
  "project_uuid" : "03d55a9eb29643809f4120cd628968fa",
  "version_uri" : "005t8asecn21",
  "case_uris" : [ "001rv9521lf1" ],
  "owner_ids" : [ "efdb403066474ab08836b9eeaaa23bca" ],
  "status_codes" : [ "0", "1" ],
  "rank_ids" : [ "1", "2" ],
  "module_ids" : [ "-2" ],
  "issue_id" : "3917852",
  "creator_ids" : [ "efdb403066474ab08836b9eeaaa23bca" ],
  "result_codes" : [ "0", "1" ],
  "iteration_ids" : [ "2000adec0b854306bf013e84f7b5f9ea" ],
  "create_start_time" : "2021-11-04 00:00:00",
  "create_end_time" : "2021-11-04 23:59:59",
  "associated_issue" : true,
  "associated_defects" : true,
  "include_sub_issue" : false,
  "include_sub_feature" : false,
  "label_ids" : [ "17220c4560ab4e5b913aaa40895183fb" ],
  "execute_start_time" : "2021-11-04 00:00:00",
  "execute_end_time" : "2021-11-04 23:59:59",
  "executor_ids" : [ "efdb403066474ab08836b9eeaaa23bca" ],
  "test_types" : [ "1" ],
  "is_keyword" : false,
  "issue_tree_search" : false,
  "service_type" : 3,
  "service_types" : [ 0, 1, 6 ],
  "stage_type" : 2,
  "feature_uri" : "004s6kfel2q",
  "sort_field" : "testCaseNumber",
  "sort_type" : "ASC",
  "page_no" : 1,
  "page_size" : 10,
  "case_type" : 0,
  "custom_field_info" : [ { } ],
  "task_uri" : "taskUri",
  "associate_issue_detail" : true,
  "not_assign_task" : true,
  "test_designs" : [ true ],
  "review_status" : 0,
  "just_return_id" : true,
  "iterator_uri_condition" : "string"
}
```
#### 响应示例
**状态码：200**
OK
```
{
  "value" : [ "v92s00010hovp2cp" ]
}
```
#### 状态码
| 状态码 | 描述                    |
|:---|:---|
| 200 | OK                    |
| 400 | Bad Request           |
| 401 | Unauthorized          |
| 404 | Not Found             |
| 500 | Internal Server Error |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-testman/ErrorCode.html)。
