Create a Test Case Tree
Starting October 11, 2024 (Zephyr Enterprise 8.2), the Zephyr Enterprise documentation moved from its current location on Atlassian to a dedicated, standalone Zephyr Enterprise documentation page. Please see: Create a Test Case Tree | Zephyr Enterprise Documentation
Create a folder or phase
Use the following operation to create a folder or phase in Zephyr Enterprise:
POST /flex/services/rest/v3/testcasetree?parentid=0&assignedusers=
Request format
To create a folder or phase, send a POST request to the following URL:
http://{ZEPHYR-SERVER}/flex/services/rest/v3/testcasetree?parentid=0&assignedusers=
Request body
{
"name":"N4",
"description":"",
"type":"Phase",
"releaseId":1
}
releaseId - the ID of the release.
For information on creating a tree node, see Create Tree Node.
Response body
{
"id": 17,
"type": "Phase",
"name": "N4",
"description": "",
"revision": 0,
"categories": [],
"assignedUsers": [1,2,3,5,6,7,8],
"releaseId": 1,
"linkedTCRCatalogTreeId": 0,
"createdOn": 1588073471630,
"createdBy": 1,
"lastModifiedBy": 1,
"lastModifiedOn": 1588073471641,
"testcaseCount": 0,
"cumulativeTestcaseCount": 0
}
Create a sub-folder or sub-phase
Use the following operation to create a sub-folder or sub-phase in Zephyr Enterprise:
POST /flex/services/rest/v3/testcasetree?parentid={ID of the parent folder}
Request format
To create a sub-folder or sub-phase, send a POST request to the following URL:
http://{ZEPHYR-SERVER}/flex/services/rest/v3/testcasetree?parentid={ID of the parent folder}
Request body
{
"name":"Sub Folder",
"description":"",
"type":"Module",
"releaseId":1
}
releaseId - the ID of the release.
parentid - the ID of the parent folder of the sub-folder you want to create.
For information on creating a tree node, see Create Tree Node.
Response body
Create a test case
Use the following operation to create a test case in Zephyr Enterprise:
POST /flex/services/rest/latest/testcase/
Request format
To create a test case, send a POST request to the following URL:
http://{ZEPHYR-SERVER}/flex/services/rest/latest/testcase/
Request body
tcrCatalogTreeId - the ID of the folder where you want to create the test case.
For more information on creating test cases, see Create Test Case.
Response body
Add an attachment
Prerequisites
To attach a file to a test case, you need to upload it to the server. To do that:
1. Upload the file as a multi-request to /flex/upload/document/genericattachment
via a cURL command or Postman. This will return the file name and location in the JSON format.
2. Call the createAttachment API passing the name and location of the uploaded file. On success, the file will be attached.
Attach the uploaded file
To attach the uploaded file to your test case, specify the file path you got upon uploading the file (see above) in the tempPath
attribute of a createAttachment
API request and send the request.
API operation
POST /flex/services/rest/latest/attachment/list
Request format
To attach an uploaded file to a test case, send a POST request to the following URL:
http://<server-ip>/flex/services/rest/latest/attachment/list
Request body
tempPath - the path to the uploaded file.
On success (HTTP/1.1 200 OK), the file will be attached.
Update an existing test case (update the tag, priority, custom fields, etc.)
Use the following operation to update a test case in Zephyr Enterprise:
PUT /flex/services/rest/v3/testcase/{id}
Request format
To update a test case, send a PUT request to the following URL:
http://{ZEPHYR-SERVER}/flex/services/rest/v3/testcase/{id}
{id} - the ID of the entity you want to update.
Request body
Response body
Create a test step
Use the following operation to create a test step in Zephyr Enterprise:
POST /flex/services/rest/latest/testcase/{testcaseVersionId}/teststep/detail/{tctId}
Request format
To create a test step, send a POST request to the following URL:
http://{ZEPHYR-SERVER}/flex/services/rest/latest/testcase/{testcaseVersionId}/teststep/detail/{tctId}
{testcaseVersionId} - the ID of the test case version.
tctId - test case ID in the test case tree.
Request body
tcId - the test case ID.
maxId - the maximum number of steps.
orderId - the step order ID.
Response body
For more information on test step creation, see Create Test Step.
Update a test step
Use the following operation to update an existing test step in Zephyr Enterprise:
PUT /flex/services/rest/latest/testcase/{testcaseVersionId}/teststep/detail/{tctId}
Request format
To update an existing test step, send a PUT request to the following URL:
http://{ZEPHYR-SERVER}/flex/services/rest/latest/testcase/{testcaseVersionId}/teststep/detail/{tctId}
{testcaseVersionId} - the ID of the test case version.
tctId - test case ID in the test case tree.
Request body
tcId - the test case ID.
maxId - the maximum number of steps.
orderId - the step order ID.
See Also
Â
Starting Release 8.2, Zephyr Enterprise documentation is moving from its current location on Atlassian to a dedicated, standalone Zephyr Enterprise Documentation page. https://support.smartbear.com/zephyr-enterprise/docs/en/welcome-to-zephyr-enterprise.html