Step-by-Step Process for the Import of the Testcase

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/import-the-test-case.html

Create the Map

Public Document Reference: - https://zephyrenterprisev3.docs.apiary.io/#reference/fieldmap/create-field-map/create-field-map
End Point: - /flex/services/rest/latest/fieldmap/
Method: - POST

Picture6-20240405-105434.png

Import Job via Excel (Only xlsx format Supported)

Public Document Reference: - https://zephyrenterprisev3.docs.apiary.io/#reference/import/add-new-import-job/add-new-import-job
Method: - POST
End Point: - /flex/services/rest/v3/import/
Example Request Body: -

{ "name": "Job_Name", "scheduledDate": 1694672045629, "folder": "tc_import_utf8_DO_NOT_DELETE.xlsx", "fileExtension": ".xls", "fieldMapId": 4, "releaseId": 1, "importEntityType": "testcase", "status": "11000", "isUpload": true }

Example Request Response: -

{ "id": 1, "name": "Job_Name ", "folder": "tc_import_utf8_DO_NOT_DELETE.xlsx", "fileExtension": ".xls", "scheduledDate": 1694672045629, "status": "11000", "fieldMap": { "id": 4, "name": "Map", "description": "", "creationDate": 1694588400000, "projectId": 1, "startingRowNumber": 2, "discriminator": "bytestcasenamechange", "fieldMapDetails": [ { "zephyrField": "1", "mappedField": "B" }, { "zephyrField": "2", "mappedField": "D" }, { "zephyrField": "21", "mappedField": "A" }, { "zephyrField": "3", "mappedField": "F" }, { "zephyrField": "22", "mappedField": "E" } ], "fieldMapEntityType": "testcase" }, "fieldMapId": 4, "releaseId": 1, "importEntityType": "testcase", "isUpload": true }
Picture7-20240405-110031.png


Upload the Excel file

Public Document Reference: -  Add an Attachment
Method:- POST
End Point: - /flex/upload/document/genericattachment?jobid={JobID from the above API}
Example: - /flex/upload/document/genericattachment?jobid=1

In Body select the form-data and add

Key name: - import and select the type as a file
Key value adds the attachment

See the below Example: -

Execute import job by id

Public Document Reference: -  https://zephyrenterprisev3.docs.apiary.io/#reference/import/execute-import-job-by-id/execute-import-job-by-id
Method:- PUT
End Point: - /flex/services/rest/v3/import/execute/{JobID}/run
Example: - /flex/services/rest/v3/import/execute/1/run

Request Body: -

{ "id": {JobID}, "action": "run" }

Example Request Body: -

See Also

Migration REST API