GetTestcaseList
Retrieves a filterable list of test cases from the test case repository.
Operation description
Retrieves a list of test cases from the test case library. You can use the conditions parameter to filter the results.
Try it now
Test
RAM authorization
Request syntax
POST /organization/{organizationId}/testhub/testcases HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| organizationId |
string |
Yes |
The ID of the organization. |
5ebbc0228123212b59xxxxx |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body. |
|
| spaceIdentifier |
string |
Yes |
The unique identifier of the test case library. |
6d5984c7d92b23fa53d4743c37 |
| directoryIdentifier |
string |
No |
The unique identifier of the directory. Omit this parameter to return all test cases from the test case library. |
e27b8eace6501ce51cf5d56784 |
| conditions |
string |
No |
The conditions for filtering test cases, provided as a JSON string. |
{\"conditionGroups\":[[{\"fieldIdentifier\":\"status\",\"operator\":\"CONTAINS\",\"value\":[\"cc961a18adf770c6e423ccc5\"],\"toValue\":null,,\"className\":\"status\",\"format\":\"list\"}]]} |
| nextToken |
string |
No |
The token for paginating results. Leave this parameter empty for the first request. For subsequent requests, use the |
2591861102250c4522380b33a6 |
| maxResult |
string |
No |
The maximum number of results to return per page. The default value is 20. |
20 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response object. |
||
| totalCount |
integer |
The total number of results. |
10 |
| nextToken |
string |
The pagination token. This value is empty when there are no more results. |
"" |
| maxResults |
integer |
The maximum number of items returned per page. |
20 |
| requestId |
string |
The unique ID of the request, used for troubleshooting. |
ASSDS-ASSASX-XSAXSA-XSAXSAXS |
| errorMsg |
string |
The error message. |
error |
| errorCode |
string |
The error code. |
Openapi.RequestError |
| success |
boolean |
Indicates if the request was successful. Valid values: |
true |
| testcase |
array<object> |
The test cases. |
|
|
array<object> |
A test case. |
||
| identifier |
string |
The unique ID of the test case. |
e8bxxxxxxxxxxxxxxxx23 |
| subject |
string |
The title of the test case. |
测试工作项 |
| assignedTo |
object |
The assignee. |
|
| assignedToIdenttifier |
string |
The unique ID of the assignee. |
12xxxxx456 |
| name |
string |
The name of the assignee. |
人员名称 |
| space |
object |
The test case library. |
|
| spaceIdentifier |
string |
The unique ID of the test case library. |
22c32972b853cd703dbf0efe4c |
| type |
string |
The space type. |
TestRepo |
| categoryIdentifier |
string |
The category ID of the test case. |
Req |
| gmtCreate |
integer |
The creation time of the test case, in Unix milliseconds. |
1621578648000 |
| customFields |
array<object> |
The custom fields. |
|
|
object |
A custom field. |
||
| fieldIdentifier |
string |
The unique ID of the custom field. |
85702b33f14bfa82cb458173ba |
| value |
string |
The value of the custom field. |
d7f112f9d023e2108fa1b0d8 |
| fieldFormat |
string |
The format of the custom field. |
Input |
| fieldClassName |
string |
The class name of the custom field. |
User |
| tags |
array<object> |
The tags. |
|
|
object |
A tag. |
||
| tagIdentifier |
string |
The unique ID of the tag. |
85702b33f14bxxxxxx58173ba |
| name |
string |
The name of the tag. |
标签名称 |
Examples
Success response
JSON format
{
"totalCount": 10,
"nextToken": "\"\"",
"maxResults": 20,
"requestId": "ASSDS-ASSASX-XSAXSA-XSAXSAXS",
"errorMsg": "error",
"errorCode": "Openapi.RequestError",
"success": true,
"testcase": [
{
"identifier": "e8bxxxxxxxxxxxxxxxx23",
"subject": "测试工作项",
"assignedTo": {
"assignedToIdenttifier": "12xxxxx456",
"name": "人员名称"
},
"space": {
"spaceIdentifier": "22c32972b853cd703dbf0efe4c",
"type": "TestRepo"
},
"categoryIdentifier": "Req",
"gmtCreate": 1621578648000,
"customFields": [
{
"fieldIdentifier": "85702b33f14bfa82cb458173ba",
"value": "d7f112f9d023e2108fa1b0d8",
"fieldFormat": "Input",
"fieldClassName": "User"
}
],
"tags": [
{
"tagIdentifier": "85702b33f14bxxxxxx58173ba",
"name": "标签名称"
}
]
}
]
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Openapi.RequestError | request error | |
| 403 | Operate.NoPermission | NoPermission | You are not authorized to perform this operation. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.