...
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
...
Respose codes
The API operations described below use the following operation:
POST http://<zephyr-server-address>/flex/services/rest/v4/upload-file/automation/create-job-detail
Request data
...
title | 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.
Expand | ||
---|---|---|
| ||
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.
response codes:
Response code | Description |
---|---|
200 | The operation has been completed successfully. |
400 | Error in request data or parameters. For instance, the project or job with the specified id doesn’t exist. |
401 | Authentication error (authentication token is missing). |
403 | Error. You don’t have permissions to perform this operation. |
500 | Internal server error. |
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
Expand | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||
The request body has an object with the following properties:
|
Expand | ||
---|---|---|
| ||
|
Response data
...
title | Example |
---|
...
If the operation succeeded, the response has the 200 OK
status and the response body contains the created job properties. The id
property is the job's identifier. You can use it later in operations that update job properties or delete a job.
Expand | ||
---|---|---|
| ||
{ |
If the operation failed, it returns one of the error codes.
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
...
title | Description |
---|
...
The request body contains an object with the ids
property that is an array of job identifiers to be used for the run:
Code Block |
---|
{"ids":[1, 2, 3]} |
Response data
If the operation succeeds, the response code is 200 OK
and the response body contains information on the scheduled run. The id
property is the identifier of the run. You can use it later to check the job status, or to stop or cancel a job.
Expand | ||
---|---|---|
| ||
|
If the operation fails, it returns of the error codes.
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
The request body specifies the name, project, release, cycle, and other properties of the created job. These are the same values described above.
Expand | ||
---|---|---|
| ||
|
...
Expand | ||
---|---|---|
| ||
|
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<zephyr-server-address}address>/flex/services/rest/v4/upload-file/automation/fileschedule/get-uploadlatest-job/list-progress?projectIdjobid={12}&releaseId={34}ID}
Parameters
projectId
ID
- Integer. The Jira identifier of the desired project (not the project key).releaseId - Integer. The Jira identifier of the desired release in that projectjob whose status you request. You get this identifier in the response to the operation that created the job.
Response data
The response body has a JSON array with information on all the found job for the specified project and releaseIf the operation succeeds, the response status is 200 OK
and the response body has information on the job and its cycle.
Expand | ||
---|---|---|
| ||
|
In case of an error, the operation returns one of the error codes.
Stop or cancel a job
To stop or canel a job, use the following operation:
POST http://{zephyr-server-address}/flex/services/rest/v4/upload-file/automation/cancel/{ID}
Parameters
ID
- The identifier of the scheduled run. You can find it in the response to the operation that scheduled the job run - it’s theid
property of the object in the response body.
Request data
The operation doesn’t use request body.
Response data
If the operation succeeds, the response status is 200 OK
and the response body contains true
.
If the operation fails, it returns one of the error codes.
Get job properties
Use the following operation to get properties of an automation job:
GET http://<zephyr-server-address>/flex/services/rest/v3/automation/job/detail?jobid={ID}
Request data and URL parameters
The request body is not used. The ID
parameter specifies the identifier of the desired job. You get this identifier in a response to the operation that created the job.
Response data
If the operation succeeded, the response status is 200 OK and the response body contains information on the specified job.
Expand | ||
---|---|---|
| ||
|
If the operation fails, it returns of the error codes.
Update job properties
Use the following operation:
POST http://<zephyr-server-address>/flex/services/rest/v4/upload-file/automation/update-execute-job
Request data
Response data
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={projectID}&releaseId={releaseID}
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
If the operation was successful, the response status is 200 OK
and the response body has a JSON array with information on all the found job for the specified project and release.
Expand | ||
---|---|---|
| ||
|
If the operation fails, it returns one of the error codes.
Delete a job
Use this operation:
POST http://<zephyr-server-address>/flex/services/rest/v3/automation/job/delete
The request body specifies the jobs to be deleted.
Request data
The request body contains identifiers of jobs to be deleted. These are identifiers you get for a job in the response to the request that created that job:
Code Block |
---|
{ "ids": [ 1,"jobDetailTcrCatalogTreeId": 202,"phaseName": "new" 3, ... ]"testRepositoryPath": "Release 1.0 > new", "attachmentId": 215, }
|
If you need to delete just one job, specify only one id in the array, for example:
Code Block |
---|
{ "ids": [ 12"attachmentName": "TESTMapAttachment.xml" } ] |
...
]
} |
Response data
The operation returns 200 OK
, if the job or jobs have been deleted successfully. In case of an error, the operation returns one of the error codes.