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

note

In Body select the form-data and add

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

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: -

Picture8-20240405-110402.png

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: -

{
    "id": 1,
    "action": "run"
}
Picture9-20240405-110541.png

See Also

Migration REST API