Test Automation API Documentation

go.gifCreate an automation Task

go.gifUpdate an automation task

go.gifRetrieve automation task details

go.gifRetrieve task details by project

go.gifDelete an automation task

go.gifDelete multiple automation tasks

go.gifUpload a file for an automation task

go.gifExecute an automation task

go.gifRetrieve automation task status

Create an automation Task

This API operation creates an automation task, which is the entry point for the automation functionality.

REQUEST

POST https://<client server base URL>/rest/zapi/latest/automation/job/create

Content-Type: application/json

POST Body

{

"projectId": "",

"automationType": "",

"taskName": "Name of the task",

"description": "",

"automationTool": "",

"versionId": "",

"cycleId": "",

"folderId": "",

"cycleName": "",

"folderName": "",

"assigneeDisplayName": ""

"cycleStartDate": "01/01/20",

"cycleEndDate": "03/01/20",

}
  • projectId: the ID of the project.

  • automationType: the type of the task to be created (UPLOAD or ZBOT).

  • taskName: the name of the task to be created.

  • description: the description of the task to be created.

  • automationTool: the name of the automation framework where tests are executed.

  • versionId: the ID of the version where the cycle will be created.

  • cycleId: the ID of the cycle which is created under the selected version.

  • folderId: the ID of the folder which is created under the selected cycle.

  • cycleName: the name of the cycle under which all the executions will be created.

  • folderName: the name of the folder under which all the executions will be created.

  • assigneeDisplayName: the name of the user all the executions will be assigned to.

  • cycleStartDate: the start date of the cycle (dd/mm/yy).

  • cycleEndDate: the end date of the cycle (dd/mm/yy).

RESPONSE

Response Body

{

"JOB_ID": "",

"message": ""

}
  • JOB_ID: the ID of the task that has been created.

  • message: a message sent if the task couldn’t be created.

Response Codes

  • 200: The request was accepted and processed successfully.

  • 400: Bad request or it is not configured properly. Please check the error message in the response body.

  • 401: Unauthorized, please check your username /password and ensure that they are correct and in the expected format.

  • 403: Forbidden, please check that you have the required permissions to execute this command.

  • 404: API URL not found/configured properly.

  • 500: Please ensure that the server is up and running and zephyr-squad-server is configured correctly before using the API.

Update an automation task

This API operation updates an existing automation task.

REQUEST

PUT https://<client server base URL>/rest/zapi/latest/automation/job/update/{automationId}

Content-Type: application/json

Parameters:

automationId: The ID of the task to be updated.

POST Body

The fields a user can update:

  • automationType: the type of the task to be created (UPLOAD or ZBOT).

  • taskName:nthe name of the task to be created.

  • description: the description of the task to be created.

  • automationTool: the name of the automation framework where tests are executed.

  • versionId: the ID of the version in which the cycle will be created.

  • cycleId: the ID of the cycle that will be created under the selected version.

  • folderId: the ID of the folder that will be created under the selected cycle.

  • cycleName: the name of the cycle under which all the executions will be created.

  • folderName: the name of the folder under which all the executions will be created.

  • assigneeDisplayName: the name of the user all the executions will be assigned to.

  • cycleStartDate: the start date of the cycle.

  • cycleEndDate: the end date of the cycle.

RESPONSE

Response Body

{

"JOB_ID": "",

"message": ""

}

  • JOB_ID: the ID of the task that has been updated.

  • message: a message sent if the task couldn’t be updated.

Response Codes

  • 200: The request was accepted and processed successfully

  • 400: Bad request or it is not configured properly. Please check the error message in the response body.

  • 401: Unauthorized, please check your username /password and ensure that they are correct and in the expected format.

  • 403: Forbidden, please check that you have the required permissions to execute this command.

  • 404: API URL not found/configured properly.

  • 500: Please ensure that the server is up and running and Zephyr is configured correctly before using the API.

Retrieve automation task details

This API operation retrieves information about a task by its ID.

REQUEST

GET https://<client server base URL>/rest/zapi/latest/automation/job /{automationId}

Parameters:

automationId: the ID of the task information about which will be retrieved.

RESPONSE

Response Body

{

"taskName": "",

"taskId": "",

"uploadFileName": "",

"automationType": "",

"taskDescription": "",

"projectId": "",

"versionId": "",

"modifiedDate": "",

"createdDate": "",

"automationTool": "",

"resultPath": "",

"cycleName": "",

"cycleId": "",

"folderName": "",

"folderId": "",

"assigneeUser": "",

"cycleStartDate": "",

"cycleEndDate": "",

"cycleStartDateFormatted": "",

"cycleEndDateFormatted": "",

"executionStatus": "",

"errorMessage": "",

"assigneeDisplayName": "",

"assigneeName": "",

"versionName": "",

"fileUploaded": ""

}

Response Codes

  • 200: The request was accepted and processed successfully.

  • 400: Bad request, the task was not found.

  • 401: Unauthorized, please check your username /password and ensure that they are correct and in the expected format.

  • 403: Forbidden, please check that you have the required permissions to execute this command.

  • 404: API URL not found/configured properly.

  • 500: Please ensure that the server is up and running and Zephyr is configured correctly before using the API.

Retrieve task details by project

This API operation retrieves the details of all the tasks used in a specific project.

REQUEST

GET https://<client server base URL>/rest/zapi/latest/automation/job/byproject/{projectId}

Parameters:

projectId: the ID of the project.

RESPONSE

Response Body

{

"taskId1": {

Task information in JSON format

},

"taskId2": {

Task information in JSON format

},

...

"taskIdN": {

Task information in JSON format

}

}

Response Codes

  • 200: The request was accepted and processed successfully.

  • 400: Bad request. The project was not found.

  • 401: Unauthorized, please check your username /password and ensure that they are correct and in the expected format.

  • 403: Forbidden, please check that you have the required permissions to execute this command.

  • 404: API URL not found/configured properly.

  • 500: Please ensure that the server is up and running and Zephyr is configured correctly before using the API.

Delete an automation task

This API operation deletes a task specified by its ID.

REQUEST

DELETE https://<client server base URL>/rest/zapi/latest/automation/job/delete/{automationId}

Parameters:

automationId: the ID of the task to be deleted.

Request Body

{

"jobs" : []

}

RESPONSE

Response Body

{

"message": ""

}
  • message: a message sent if the task couldn’t be deleted.

Response Codes

  • 200: The request was accepted and processed successfully.

  • 400: Bad request. The task was not found.

  • 401: Unauthorized, please check your username /password and ensure that they are correct and in the expected format.

  • 403: Forbidden, please check that you have the required permissions to execute this command.

  • 404: API URL not found/configured properly.

  • 500: Please ensure that the server is up and running and Zephyr is configured correctly before using the API.

Delete multiple automation tasks

This API operation deletes multiple automation tasks.

REQUEST

DELETE https://<client server base URL>/rest/zapi/latest/automation/job /delete/{automationId}

Content-Type: application/json

Request Body

{

"jobs": [id1, id2, …, idN]

}

RESPONSE

Response Body

{

"message": ""

}
  • message: a message sent if the tasks couldn’t be deleted.

Response Codes

  • 200: The request was accepted and processed successfully.

  • 400: Bad request. The task was not found.

  • 401: Unauthorized, please check your username /password and ensure that they are correct and in the expected format.

  • 403: Forbidden, please check that you have the required permissions to execute this command.

  • 404: API URL not found/configured properly.

  • 500: Please ensure that the server is up and running and Zephyr is configured correctly before using the API.

Upload a file for an automation task

This API operation uploads a file and associates it with a task specified by its ID.

Note

Currently, only the XML file format is supported for upload.

REQUEST

POST https://<client server base URL>/rest/zapi/latest/automation/upload/{automationId}

Parameters:

automationId: the ID of the task the file will be uploaded for.

Content-Type: multipart/form-data

Request Parameters

{

"file": "The file to be uploaded."

}

RESPONSE

Response Body

{

"JOB_ID": "",

"message": ""

}

  • message: a message sent if the file couldn’t be uploaded.

Response Codes

  • 200: The request was accepted and processed successfully.

  • 400: Bad request. The task was not found.

  • 401: Unauthorized, please check your username /password and ensure that they are correct and in the expected format.

  • 403: Forbidden, please check that you have the required permissions to execute this command.

  • 404: API URL not found/configured properly.

  • 500: Please ensure that the server is up and running and Zephyr is configured correctly before using the API.

Execute an automation task

This API operation executes an automation task specified by its ID.

REQUEST

POST https://<client server base URL>/rest/zapi/latest/automation/job/execute/{automationId}

Parameters:

automationId: the ID of the task to be executed.

RESPONSE

Response Body

{

"message": ""

}

  • message: a message sent if the task couldn’t be executed.

Response Codes

  • 200: The request was accepted and processed successfully.

  • 400: Bad request. The task was not found.

  • 401: Unauthorized, please check your username /password and ensure that they are correct and in the expected format.

  • 403: Forbidden, please check that you have the required permissions to execute this command.

  • 404: API URL not found/configured properly.

  • 500: Please ensure that the server is up and running and Zephyr is configured correctly before using the API.

Retrieve automation task status

This API operation get the status of a task specified by its ID.

REQUEST

GET https://<client server base URL>/rest/zapi/latest/automation/job/status/{automationId}

Parameters:

automationId: The ID of the task whose status you want to get.

RESPONSE

Response Body

{

"Status": "",

"errorMessage": ""

}

  • Status: the status of the task. Possible values: UNEXECUTED, SCHEDULED, IN_PROGRESS, SUCCESS, FAIL.

  • errorMessage: a message sent when the task status is FAIL.

Response Codes

  • 200: The request was accepted and processed successfully.

  • 400: Bad request. The task was not found.

  • 401: Unauthorized, please check your username /password and ensure that they are correct and in the expected format.

  • 403: Forbidden, please check that you have the required permissions to execute this command.

  • 404: API URL not found/configured properly.

  • 500: Please ensure that the server is up and running and Zephyr is configured correctly before using the API.

See Also

Test Automation API Documentation

Test Automation

Continuous Integration

Publication date: