Obtaining Details of the Test Cases in a Test Suite
Function
This API is used to obtain details of the test cases in a test suite.
Calling Method
For details, see Calling APIs.
URI
POST /v4/{project_id}/tasks/{task_uri}/testcases/batch-query
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project UUID, which uniquely identifies a project. The value must contain 32 characters (letters and digits). For details, see Obtaining a Project ID. |
| task_uri | Yes | String | Task URI. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| stage | No | Integer | Phase of a test case in a task. |
| owners | No | Array of strings | Handlers for filtering. |
| page_no | No | Integer | Page number. |
| page_size | No | Integer | Number of pages. The value ranges from 1 to 1000. |
| results | No | Array of strings | Result filter. |
| status | No | Array of strings | Status for filtering. |
| version_uri | No | String | Branch/Sprint URI. |
| release_dev | No | String | Task version filtering condition, which affects the query result of associated tasks. The latest test case result in the current task version is queried. |
| sort_field | No | String | Sorting field. |
| sort_type | No | String | Definition Sorting method. Constraints N/A Range Default Value N/A |
| feature_uri | No | String | Feature URI. |
| task_result_uri | No | String | URI of the test suite result. |
| rank_ids | No | Array of integers | Test case level IDs. |
| key_word | No | String | Keyword |
| issue_id | No | String | Requirement ID. |
| associated_issue | No | Boolean | Whether the test case is associated with a requirement. null: not limited; false: not associated; true: associated. |
| select_all_pages | No | Boolean | Whether all pages are selected (null: no; false: no; true: yes). This parameter is used for batch task execution results. Only the case URI is returned. |
| is_available | No | Boolean | Whether a test case is available. |
| is_script_exist | No | Boolean | Whether the case script field has a value. |
| is_contain_child | No | Boolean | Whether to include subdirectories. The default value is true. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| value | Array of TaskAssignCaseDetailVo objects | Return parameters for obtaining details of the test cases in a test suite. |
| Parameter | Type | Description |
|---|---|---|
| uri | String | Association URI. |
| sort | Integer | Sorting order. |
| owner | String | Owner ID. |
| stage | Integer | Test phase. |
| project_id | String | Project UUID, which uniquely identifies a project. The value must contain 32 characters (letters and digits). For details, see Obtaining a Project ID. |
| task_uri | String | Task URI. |
| update_time | String | Update time. |
| updator_name | String | Updater. |
| updator | String | Updater ID. |
| case_uri | String | Case URI. |
| is_available | Integer | Available or not. |
| test_case_name | String | Test case name. |
| feature_uri | String | Case directory URI. |
| test_case_number | String | Test case ID. |
| svn_script_path | String | Script path. |
| status_code | String | Status. |
| status_name | String | Status name. |
| result_code | String | Result ID. |
| result_name | String | Result name. |
| owner_name | String | Owner name. |
| execute_latest_time | String | Time of the last execution. |
| execute_duration | String | Execution duration. |
| is_keyword | Integer | Whether the test case is a key one. |
| net_work_script_name | String | Script name. |
| rank_id | Integer | Test case level. |
| remark | String | Description. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code displayed after the API fails to be called. |
| error_msg | String | Error message displayed after the API fails to be called. |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code displayed after the API fails to be called. |
| error_msg | String | Error message displayed after the API fails to be called. |
Status code: 404
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code displayed after the API fails to be called. |
| error_msg | String | Error message displayed after the API fails to be called. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code displayed after the API fails to be called. |
| error_msg | String | Error message displayed after the API fails to be called. |
Example Requests
post https://{endpoint}/v4/projects/f3087a82b44744c29a1bd69ab6ada154/tasks/v90100010gmi4h0j/testcases/batch-query
{
"page_no" : 1,
"page_size" : 15,
"results" : [ ],
"status" : [ ],
"version_uri" : "v90200010aelu5om",
"owners" : [ ],
"rank_ids" : [ ]
} Example Responses
Status code: 200
OK
{
"value" : [ {
"uri" : "v90100010gmi4sgs",
"sort" : 1,
"owner" : "",
"stage" : 1,
"project_id" : "407ac57de7ea44d28e47293a2b9cf15c",
"task_uri" : "v90100010gmi4h0j",
"update_time" : "2025-05-29 10:25:40",
"updator_name" : "sec_admin——nich",
"updator" : "2ce06fffb4634271a377c1cd7c429704",
"case_uri" : "v90410b5o5ce22a7",
"is_available" : 1,
"test_case_name" : "cx_2995",
"test_case_number" : "7417",
"status_code" : "7",
"status_name" : "Completed",
"result_code" : "1",
"result_name" : "Failed",
"is_keyword" : 0,
"rank_id" : 2
}, {
"uri" : "v90110gmi4sgsf2e",
"sort" : 2,
"owner" : "",
"stage" : 1,
"project_id" : "407ac57de7ea44d28e47293a2b9cf15c",
"task_uri" : "v90100010gmi4h0j",
"update_time" : "2025-05-29 10:25:39",
"updator_name" : "sec_admin——nich",
"updator" : "2ce06fffb4634271a377c1cd7c429704",
"case_uri" : "v90200010gmhoo73",
"is_available" : 1,
"test_case_name" : "sdw",
"test_case_number" : "7421",
"status_code" : "0",
"status_name" : "New",
"result_name" : "Not executed",
"is_keyword" : 0,
"rank_id" : 2
} ]
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
| 400 | Bad Request |
| 401 | Unauthorized |
| 404 | Not Found |
| 500 | Internal Server Error |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot