Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

….

Base URL, authentication, data formats

The operations described below work for both Cloud and On-Premise instances of Zephyr Enterprise. They use the same authentication parameters and data formats that other Zephyr API operations use. For complete information on these, see Zephyr REST API.

Create an automation job

To create a new automation job, use the following operation:

POST http://<zephyr-server-address>/flex/services/rest/v4/upload-file/automation/create-job-detail

Request data

 Request body

The request body has an object wirh the following properties:

Property

Description

jobName

String. The name of the new job. It will identify the job in the product UI. This parameter cannot be an empty string.

projectId

Integer. The identifier of the project, to which the new job will post the results.

 How to get the project id

Log in to Zephyr, and select your project from the drop-down list on the top. You will see the project id in the URL:

releaseId

Integer. The identifier of the release, to which the new job will post the results.

 How to get the release id

Log in to Zephyr and select your project and release from the drop-down lists on the top. You will see the release id in the URL:

automatedFramework

String. The automation framework to be used for the test run. Use the same values that the Automation Framework drop-down list in the product UI has.

cycleName

String. The name of the cycle to be used.

phaseName

String. The cycle phase to be used for the run.

jobDetailTcrCatalogTreeId

Integer. Id of the test case repository item.

testRepositoryPath

The Zephyr test repository that contains the tests to be executed. Use the names as they are shown in the product UI. Separate levels with the > symbol, for example, "Release 1.0 > new".

cycleStartDateStr,
cycleEndDateStr

Specifies the start and end dates of the cycle. as strings in the mm/dd/yyyy format.

IsReuse

true or false. Specifies if the test engine will use the same cycle for all the automation runs (true) or if it will create a new cycle for each run (false).

assignResultsTo

Integer. The id of the user to whom the test engine will assign results.

 Example
{
 "releaseId": 5,
 "jobName": "Demo123",
 "automationFramework": "junit",
 "cycleName": "cycle",
 "jobDetailTcrCatalogTreeId": 32,
 "projectId": 9,
 "testRepositoryPath": "Release 1.0 > new",
 "cycleStartDateStr": "02/03/2022",
 "cycleEndDateStr": "02/21/2022",
 "isReuse": true,
 "assignResultsTo": "1",
 "phaseName": "new""
}

Response data

 Example

{
    "id": 1,
    "projectId": 5,
    "releaseId": 9,
    "automationFramework": "junit",
    "jobCrationDate": 1643879564994,
    "createdBy": "test test",
    "cycleDuration": 18,
    "isTimeStamp": false,
    "createPackage": false,
    "assignResultsTo": 1,
    "cycleName": "cycle",
    "phaseName": "new",
    "isReuse": true,
    "jobName": "Demo123",
    "testRepositoryPath": "Release 1.0 > new",
    "jobDetailTcrCatalogTreeId": 32,
    "cycleStartDateStr": "02/03/2022",
    "cycleEndDateStr": "02/21/2022",
    "jobSource": 2,
    "fileUplaodJobPath": "junit.xml",
    "timeStamp": false
}

Schedule a job run

To schedule the run of one or multiple jobs, use the following operation:

POST http://<zephyr-server-address>/flex/services/rest/v4/upload-file/automation/execute-job

Request data

 Description

The request body contains an object with the ids property that is an array of job identifiers to be used for the run:

{"ids":[1, 2, 3]}

Response data

 Example
[
    {
        "id": 1,
        "status": "new",
        "jobScheduleDate": 1643879667503,
        "cycleDuration": 0
    }
]

Create and execute a job

The following operation creates a new job and command the test engine to run it:

POST http://<zephyr-server-address>/flex/services/rest/v4/upload-file/automation/create-and-execute-job

Request data

 Example
{
  "releaseId":11 ,
  "jobName": "Demo123111",
  "automationFramework": "junit",
  "cycleName": "cycle",
  "jobDetailTcrCatalogTreeId": 20,
  "projectId": 6,
  "testRepositoryPath": "Release 1.0 > new",
  "cycleEndDateStr": "02/21/2022",
  "cycleStartDateStr": "02/04/2022",
  "isReuse": true,
  "assignResultsTo": "1",
  "phaseName": "new"
}

Response data

 Example
{
    "id": 20,
    "status": "new",
    "jobScheduleDate": 1643962371009,
    "cycleDuration": 0
}

Get job status

Stop or cancel a job

Update job properties

Get job properties

Get properties of several jobs

Use the following operation to get all job linked to the specified project and release:

GET http://{zephyr-server-address}/flex/services/rest/v4/upload-file/automation/file-upload-job/list?projectId={12}&releaseId={34}

Parameters

  • projectId - Integer. The Jira identifier of the desired project (not the project key).

  • releaseId - Integer. The Jira identifier of the desired release in that project.

Response data

The response body has a JSON array with information on all the found job for the specified project and release.

 Example
[
    {
        "id": 13,
        "projectId": 6,
        "releaseId": 11,
        "automationFramework": "junit",
        "status": "complete",
        "jobScheduleDate": 1643932800000,
        "createdBy": "Test Manager",
        "cycleStartDate": 1643932800000,
        "cycleEndDate": 1645401600000,
        "jobName": "Demo123111",
        "jobSource": 2,
        "jobDetailTcrCatalogTreeId": 20,
        "phaseName": "new",
        "testRepositoryPath": "Release 1.0 > new",
        "attachmentId": 190,
        "attachmentName": "TESTMapAttachment.xml"
    },
    {
        "id": 14,
        "projectId": 6,
        "releaseId": 11,
        "automationFramework": "junit",
        "status": "complete",
        "jobScheduleDate": 1643932800000,
        "createdBy": "Test Manager",
        "cycleStartDate": 1643932800000,
        "cycleEndDate": 1645401600000,
        "jobName": "Demo123111",
        "jobSource": 2,
        "jobDetailTcrCatalogTreeId": 20,
        "phaseName": "new",
        "testRepositoryPath": "Release 1.0 > new",
        "attachmentId": 191,
        "attachmentName": "TESTMapAttachment.xml"
    },
    {
        "id": 15,
        "projectId": 6,
        "releaseId": 11,
        "automationFramework": "junit",
        "status": "queued",
        "jobScheduleDate": 1643932800000,
        "createdBy": "Test Manager",
        "cycleStartDate": 1643932800000,
        "cycleEndDate": 1645401600000,
        "jobName": "Demo123111",
        "jobSource": 2,
        "jobDetailTcrCatalogTreeId": 20,
        "phaseName": "new",
        "testRepositoryPath": "Release 1.0 > new",
        "attachmentId": 192,
        "attachmentName": "TESTMapAttachment.xml"
    },
    {
        "id": 16,
        "projectId": 6,
        "releaseId": 11,
        "automationFramework": "junit",
        "status": "new",
        "jobScheduleDate": 1643932800000,
        "createdBy": "Test Manager",
        "cycleStartDate": 1643932800000,
        "cycleEndDate": 1645401600000,
        "jobName": "Demo123111",
        "jobSource": 2,
        "jobDetailTcrCatalogTreeId": 20,
        "phaseName": "new",
        "testRepositoryPath": "Release 1.0 > new",
        "attachmentId": 208,
        "attachmentName": "TESTMapAttachment.xml"
    },
    {
        "id": 17,
        "projectId": 6,
        "releaseId": 11,
        "automationFramework": "junit",
        "status": "new",
        "jobScheduleDate": 1643932800000,
        "createdBy": "Test Manager",
        "cycleStartDate": 1643932800000,
        "cycleEndDate": 1645401600000,
        "jobName": "Demo123111",
        "jobSource": 2,
        "jobDetailTcrCatalogTreeId": 20,
        "phaseName": "new",
        "testRepositoryPath": "Release 1.0 > new",
        "attachmentId": 209,
        "attachmentName": "TESTMapAttachment.xml"
    },
    {
        "id": 18,
        "projectId": 6,
        "releaseId": 11,
        "automationFramework": "junit",
        "status": "new",
        "jobScheduleDate": 1643932800000,
        "createdBy": "Test Manager",
        "cycleStartDate": 1643932800000,
        "cycleEndDate": 1645401600000,
        "jobName": "Demo123111",
        "jobSource": 2,
        "jobDetailTcrCatalogTreeId": 20,
        "phaseName": "new",
        "testRepositoryPath": "Release 1.0 > new",
        "attachmentId": 210,
        "attachmentName": "TESTMapAttachment.xml"
    },
    {
        "id": 19,
        "projectId": 6,
        "releaseId": 11,
        "automationFramework": "junit",
        "status": "new",
        "jobScheduleDate": 1643932800000,
        "createdBy": "Test Manager",
        "cycleStartDate": 1643932800000,
        "cycleEndDate": 1645401600000,
        "jobName": "Demo123111",
        "jobSource": 2,
        "jobDetailTcrCatalogTreeId": 20,
        "phaseName": "new",
        "testRepositoryPath": "Release 1.0 > new",
        "attachmentId": 211,
        "attachmentName": "TESTMapAttachment.xml"
    },
    {
        "id": 20,
        "projectId": 6,
        "releaseId": 11,
        "automationFramework": "junit",
        "status": "new",
        "jobScheduleDate": 1643932800000,
        "createdBy": "Test Manager",
        "cycleStartDate": 1643932800000,
        "cycleEndDate": 1645401600000,
        "jobName": "Demo123111",
        "jobSource": 2,
        "jobDetailTcrCatalogTreeId": 20,
        "phaseName": "new",
        "testRepositoryPath": "Release 1.0 > new",
        "attachmentId": 212,
        "attachmentName": "TESTMapAttachment.xml"
    },
    {
        "id": 21,
        "projectId": 6,
        "releaseId": 11,
        "automationFramework": "junit",
        "status": "new",
        "jobScheduleDate": 1643932800000,
        "createdBy": "Test Manager",
        "cycleStartDate": 1643932800000,
        "cycleEndDate": 1645401600000,
        "jobName": "Demo123111",
        "jobSource": 2,
        "jobDetailTcrCatalogTreeId": 20,
        "phaseName": "new",
        "testRepositoryPath": "Release 1.0 > new",
        "attachmentId": 213,
        "attachmentName": "TESTMapAttachment.xml"
    },
    {
        "id": 22,
        "projectId": 6,
        "releaseId": 11,
        "automationFramework": "junit",
        "status": "new",
        "jobScheduleDate": 1643932800000,
        "createdBy": "Test Manager",
        "cycleStartDate": 1643932800000,
        "cycleEndDate": 1645401600000,
        "jobName": "Demo123111",
        "jobSource": 2,
        "jobDetailTcrCatalogTreeId": 20,
        "phaseName": "new",
        "testRepositoryPath": "Release 1.0 > new",
        "attachmentId": 214,
        "attachmentName": "TESTMapAttachment.xml"
    },
    {
        "id": 23,
        "projectId": 6,
        "releaseId": 11,
        "automationFramework": "junit",
        "status": "new",
        "jobScheduleDate": 1643932800000,
        "createdBy": "Test Manager",
        "cycleStartDate": 1643932800000,
        "cycleEndDate": 1645401600000,
        "jobName": "Demo123111",
        "jobSource": 2,
        "jobDetailTcrCatalogTreeId": 20,
        "phaseName": "new",
        "testRepositoryPath": "Release 1.0 > new",
        "attachmentId": 215,
        "attachmentName": "TESTMapAttachment.xml"
    }
]

Delete a job

  • No labels