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
Add The New Job
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/
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 }
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 }
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
Body: -
{ "id": {JobID}, "action": "run" }
Example Body: -
{ "id": 1, "action": "run" }