UpdateTestCase
Updates the attributes of a test case in the test case library, including the title, folder, and custom field information. This operation cannot be used to update the test content-related information of the test case.
Operation description
You can retrieve the list of fields for a test case by calling the operation to obtain the test case field list, and then update the test case information based on the list.
Try it now
Test
RAM authorization
Request syntax
PUT /organization/{organizationId}/testhub/testcase/{testcaseIdentifier} HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| organizationId |
string |
Yes |
The enterprise ID. |
5ebbc0228123212b59xxxxx |
| testcaseIdentifier |
string |
Yes |
The ID of the test case, which is the unique identifier of the test case. |
4e22xxxxxxxxc64c16037fe76 |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body. |
|
| updateWorkitemPropertyRequest |
array<object> |
Yes |
The requests to update test case attributes, in array format. |
|
|
object |
No |
The entity properties. |
||
| fieldIdentifier |
string |
Yes |
The ID of the test case field to be updated. |
tc.type |
| fieldValue |
string |
Yes |
The attribute value of the field to be updated. Note: 1. If the value is of the user type, you must specify the aliyunPK. 2. If the field contains candidate values, specify the ID of the corresponding candidate value. 3. If there are multiple values, separate them with commas (,) and concatenate them into a single string. |
0a032xx28107xxxx53e87a9 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| requestId |
string |
The request ID. |
ASSDS-ASSASX-XSAXSA-XSAXSAXS |
| errorMsg |
string |
The error message. |
error |
| errorCode |
string |
The error code. |
"" |
| success |
boolean |
Indicates whether the request is successful. |
true |
| Testcase |
object |
The test case object. |
|
| identifier |
string |
The ID of the test case. |
c7f7033b021ead52cc42721382 |
| subject |
string |
The title. |
Test case title |
| assignedTo |
object |
The assignee information. |
|
| assignIdentifier |
string |
The ID of the user. |
1316xxxxxx8624xxx |
| name |
string |
The username. |
Username |
| tbRoleId |
string |
The ID of the member role. |
xxxxxxxewdds12xxx |
| spaceIdentifier |
string |
The ID of the test case library. |
1e7d7a412b91a2144ec4aa8411 |
| spaceType |
string |
The workspace type. The value is TestRepo. |
TestRepo |
| categoryIdentifier |
string |
The ID of the work item type. Generally, the value is TestCase. |
TestCase |
| creator |
object |
The creator. |
|
| createIdentifier |
string |
The ID of the creator. |
1316xxxxxx8624xxx |
| name |
string |
The name of the creator. |
Zhang San |
| modifier |
object |
The modifier. |
|
| modifyIdentifier |
string |
The ID of the modifier. |
1316xxxxxx8624xxx |
| name |
string |
The name of the modifier. |
Li Si |
| directory |
object |
The folder information. |
|
| directoryIdentifier |
string |
The ID of the folder. |
e27b8eace6501ce51cf5d56784 |
| name |
string |
The name of the folder. |
All test cases folder |
| pathName |
array |
The full folder path of the test case. |
|
|
string |
The folder path name. |
[Folder 1, Folder 2] |
|
| childIdentifier |
string |
The ID of the subfolder. |
2973f597c14c6f533fffdcd05c |
| detailInfo |
object |
The test case details. |
|
| stepType |
string |
The step type. |
TEXT/TABLE |
| precondition |
object |
The precondition object. |
|
| preIdentifier |
string |
The ID of the precondition. |
3354596c7b3004480b635acf95 |
| preContent |
string |
The content of the precondition. |
Precondition content |
| preContentType |
string |
The format of the precondition. |
MARKDOWN |
| stepContent |
object |
The test step object. |
|
| stepIdentifier |
string |
The ID of the test step. |
ad504e6cdcd2165b28eb1e1b9f |
| stepContent |
string |
The content of the test step. |
Test step content |
| stepContentType |
string |
The format of the test step. |
RICHTEXT |
| expectedResult |
object |
The test step object. |
|
| expectIdentifier |
string |
The expected result ID. |
685340d13127b01185335bd360 |
| expectContent |
string |
The expected result content. |
Expected result content |
| expectContentType |
string |
The expected result format. |
MARKDOWN |
Examples
Success response
JSON format
{
"requestId": "ASSDS-ASSASX-XSAXSA-XSAXSAXS",
"errorMsg": "error",
"errorCode": "\"\"",
"success": true,
"Testcase": {
"identifier": "c7f7033b021ead52cc42721382",
"subject": "测试用例标题",
"assignedTo": {
"assignIdentifier": "1316xxxxxx8624xxx",
"name": "用户姓名",
"tbRoleId": "xxxxxxxewdds12xxx\n"
},
"spaceIdentifier": "1e7d7a412b91a2144ec4aa8411",
"spaceType": "TestRepo",
"categoryIdentifier": "TestCase\n\n",
"creator": {
"createIdentifier": "1316xxxxxx8624xxx",
"name": "张三"
},
"modifier": {
"modifyIdentifier": "1316xxxxxx8624xxx",
"name": "李四"
},
"directory": {
"directoryIdentifier": "e27b8eace6501ce51cf5d56784",
"name": "全部用例目录",
"pathName": [
"[目录一,目录二]"
],
"childIdentifier": "2973f597c14c6f533fffdcd05c"
},
"detailInfo": {
"stepType": "TEXT/TABLE",
"precondition": {
"preIdentifier": "3354596c7b3004480b635acf95",
"preContent": "前置条件内容",
"preContentType": "MARKDOWN"
},
"stepContent": {
"stepIdentifier": "ad504e6cdcd2165b28eb1e1b9f",
"stepContent": "测试步骤内容",
"stepContentType": "RICHTEXT"
},
"expectedResult": {
"expectIdentifier": "685340d13127b01185335bd360",
"expectContent": "预期结果内容",
"expectContentType": "MARKDOWN"
}
}
}
}
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.