Test Automation API Documentation
Zephyr for Jira is now Zephyr Squad! Read more about this. |
---|
- 1 Test Automation API Details
- 1.1 Create an Automation Task
- 1.2 Update an Automation Task
- 1.3 Retrieve Automation Task Details
- 1.4 Retrieve Task Details by Project
- 1.5 Delete an Automation Task
- 1.6 Delete Multiple Automation Tasks
- 1.7 Upload a File for an Automation Task
- 1.8 Execute an Automation Task
- 1.9 Retrieve Automation Task Status
Test Automation API Details
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 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
{
"key1": "value1",
"key2": "value2",
...
"keyN": "valueN"
}
The fields a user can update:
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 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: 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
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
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
RESPONSE
Response Body
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
Request Body
RESPONSE
Response Body
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.Â
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:
RESPONSE
Response Body
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: 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: 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.
Starting Release 8.2, Zephyr Enterprise documentation is moving from its current location on Atlassian to a dedicated, standalone Zephyr Enterprise Documentation page. https://support.smartbear.com/zephyr-enterprise/docs/en/welcome-to-zephyr-enterprise.html