GetTestCase - Get test case information
Applicable editions | Central edition, Region edition |
Endpoints and authorization
- Obtain an endpoint. Replace {domain} in the request syntax with the endpoint.
- Obtain a personal access token.
- Obtain an organization ID: Required only for the Central edition. Go to the organization management console and obtain the organization ID from the basic information page.
Product | Resource | Required permissions |
Test management | Test case | Read-only |
Request syntax
Central edition
GET https://{domain}/oapi/v1/testhub/organizations/{organizationId}/testRepos/{testRepoId}/testcases/{id}
Region edition
GET https://{domain}/oapi/v1/testhub/testRepos/{testRepoId}/testcases/{id}
Request header
Parameter | Type | Required | Description | Example value |
x-yunxiao-token | string | Yes | The personal access token. | pt-0fh3****0fbG_35af****0484 |
Request parameters
Parameter | Type | Location | Required | Description | Example value |
organizationId | string | path |
| The organization ID. | |
testRepoId | string | path | Yes | The ID of the test case repository. | |
id | string | path | Yes | The ID of the test case. |
Request examples
Central edition
curl -X 'GET' \
'https://{domain}/oapi/v1/testhub/organizations/{organizationId}/testRepos/{testRepoId}/testcases/{id}' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'
Region edition
curl -X 'GET' \
'https://{domain}/oapi/v1/testhub/testRepos/{testRepoId}/testcases/{id}' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'
Response parameters
Parameter | Type | Description | Example value |
| - | object | ||
| assignedTo | object | ||
| id | string | The user ID. | user-id-xxx |
| name | string | The name of the user. | name-xxx |
| creator | object | ||
| id | string | The user ID. | user-id-xxx |
| name | string | The name of the user. | name-xxx |
| customCode | string | The serial number. | DDDD-112 |
| customFieldValues | array | The custom field values. | |
| - | object | ||
| fieldFormat | string | The field type. | User |
| fieldId | string | The field ID. | field-id-xxx |
| fieldName | string | The field name. | field-name-xxx |
| values | array | The field values. | |
| - | object | ||
| displayValue | string | The display name. | |
| identifier | string | The ID of the value. | |
| directory | object | ||
| id | string | The ID of the folder. | id-xxx |
| name | string | The name of the folder. | test |
| gmtCreate | string | The time when the test case was created. | 2026-08-07T15:28:50Z |
| gmtModified | string | The time when the test case was last modified. | 2026-08-07T15:28:50Z |
| id | string | The ID of the test case. | id-xxx |
| labels | array | The labels. | |
| - | object | ||
| color | string | The color. | test |
| id | string | The ID of the label. | id-xxx |
| name | string | The name of the label. | test |
| modifier | object | ||
| id | string | The user ID. | user-id-xxx |
| name | string | The name of the user. | name-xxx |
| preCondition | string | The preconditions. HTML content is returned. | <article class="4ever-article"><p>A registered account</p></article> |
| preConditionFormat | string | The format of the preconditions. Valid values: RICHTEXT and TEXT. | RICHTEXT |
| subject | string | The title. | test |
| testRepo | object | ||
| id | string | The ID of the test case repository. | id-xxx |
| name | string | The name of the test case repository. | test |
| testSteps | object | ||
| content | array | The test step entries when contentType is set to TABLE. Write the expected result in the expected field of each entry. If contentType is set to TEXT and neither stepContent nor expectedResult is specified, the first entry is used as the test step and the expected result. | |
| - | object | ||
| expected | string | The expected result. | Expected result 1 |
| step | string | The test step. | Test step 1 |
| contentType | string | The content format. Valid values: TABLE and TEXT. | TEXT |
| expectedResult | string | The expected result when contentType is set to TEXT. In a request, pass plain text; the server converts it to rich text for storage. In a response, HTML content is returned. | Expected result 1 |
| stepContent | string | The test steps when contentType is set to TEXT. In a request, pass plain text; the server converts it to rich text for storage. In a response, HTML content is returned. If this parameter and content are both specified, this parameter takes precedence. | Test step 1 |
Response example
{
"assignedTo": {
"id": "user-id-xxx",
"name": "name-xxx"
},
"creator": {
"id": "user-id-xxx",
"name": "name-xxx"
},
"customCode": "DDDD-112",
"customFieldValues": [
{
"fieldFormat": "User",
"fieldId": "field-id-xxx",
"fieldName": "field-name-xxx",
"values": [
{
"displayValue": "",
"identifier": ""
}
]
}
],
"directory": {
"id": "id-xxx",
"name": "test"
},
"gmtCreate": "2026-08-07T15:28:50Z",
"gmtModified": "2026-08-07T15:28:50Z",
"id": "id-xxx",
"labels": [
{
"color": "test",
"id": "id-xxx",
"name": "test"
}
],
"modifier": {
"id": "user-id-xxx",
"name": "name-xxx"
},
"preCondition": "<article class="4ever-article"><p>A registered account</p></article>",
"preConditionFormat": "RICHTEXT",
"subject": "test",
"testRepo": {
"id": "id-xxx",
"name": "test"
},
"testSteps": {
"content": [
{
"expected": "Expected result 1",
"step": "Test step 1"
}
],
"contentType": "TEXT",
"expectedResult": "Expected result 1",
"stepContent": "Test step 1"
}
}
Error codes
For error codes, see the Error Code Center.