...
...
...
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
...
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
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: https://support.smartbear.com/zephyr-enterprise/docs/en/migrating-to-zephyr-enterprise/via-rest-api/create-a-test-case-tree.html |
Table of Contents |
---|
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:
...
Code Block | ||
---|---|---|
| ||
{ "tcrCatalogTreeId": 18, "testcase": { "name": "Testcase in Sub-Folder" } } |
tcrCatalogTreeId - the ID of the folder where you want to create the test case.
...
Code Block | ||
---|---|---|
| ||
{ "id": 49, "tcrCatalogTreeId": 18, "revision": 0, "stateFlag": 0, "lastModifiedOn": 1588074263271, "versionNumber": 1, "createDatetime": 1588074263271, "createdById": 1, "modifiedById": 1, "testcase": { "customProperties": {}, "customProcessedProperties": {}, "id": 31, "name": "Testcase in Sub-Folder", "lastModifiedOn": 1588074263243, "creationDate": 1588057200000, "createDatetime": 1588074263271, "tcCreationDate": "04/28/2020", "creatorId": 1, "lastUpdaterId": 1, "automated": false, "customFieldProcessed": false, "customFieldValues": [], "testcaseSequence": { "seqNumber": 29 }, "testcaseId": 29, "versionNumber": 1, "projectId": 1, "testcaseType": "ORIGINAL", "requirementIds": [], "requirementIdsNew": [], "automatedDefault": false, "testcaseShared": false }, |
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.
Expand | ||
---|---|---|
| ||
1. Download cURL and extract the zip file. 2. Open the command prompt and navigate to the src folder containing the curl.exe executable: 3. Run the following cURL command:
<file path> - the location of the file to be uploaded. <ip> - the IP address of the server. Example: 4. The above-mentioned command will return the temporary location of the uploaded file in the JSON format. You will use this path in the request body when sending a request. Example: |
Expand | ||
---|---|---|
| ||
1. Download the Postman Chrome extension. 2. After adding the Postman extension, launch Postman. Method : POST URI : 3. On the Body tab, select form-data. 4. Specify key as data, and for the value select File from the dropdown and choose the file to be uploaded:
5. Clicking on Send will return the location of the uploaded file in the JSON format. You will use this path in the request body when sending a request: |
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.)
...
Code Block | ||
---|---|---|
| ||
{ "tcId": 199, "maxId": 1, "step": { "step": "login to application", "data": "enter credentials", "result": "login successful", "orderId": 1 }, "tctId": 215 } |
tcId - the test case ID.
maxId - the maximum number of steps.
orderId - the step order ID.
Response body
...
Code Block | ||
---|---|---|
| ||
{ "id": 4, "tcId": 6, "maxId": 1, "steps": [], "step": { "customProperties": {}, "customProcessedProperties": {}, "id": 7, "localId": 1, "orderId": 1, "step": "login to application update", "data": "enter credentials update ", "result": "login successful update", "customFieldProcessed": true, "customFieldValues": [] }, "maxVersionNumber": 1, "testcaseVersionId": 6, "releaseId": 1, "projectId": 1, "tctId": 7 } |
tcId - the test case ID.
maxId - the maximum number of steps.
orderId - the step order ID.