Get Test Execution Properties

To get information on a test execution, send a GET request to /rest/zapi/latest/execution/{id}.

Request URL

GET /rest/zapi/latest/execution/{id}

The id parameter in the request path is the identifier of the desired test execution. If you created this execution through the Zephyr API, you can find the ID in the response to the corresponding request. For information on how to get the ID for an existing test execution, see Get IDs.

The request body is not used.

Other request parameters

Every request must include authentication parameters. See Zephyr Squad Server REST API.

Example

Operation reference

go.gif

https://zephyrsquadserver.docs.apiary.io/#reference/folderresource/delete-a-folder-under-a-cycle/get-execution-information

Response

A successful response has the HTTP status 200 OK. Its body contains the JSON object with properties of the specified test execution, for example:

Description of response properties

Property

Description

Id

Number. The test execution ID.

orderId

Number. The special identifier that Zephyr uses to form the test execution order. It changes every time you reorder test executions in their folder or cycle.

executionStatus

Number. Specifies the ID of the test execution status (UNEXECUTED, WIP, and others). For information on getting the status IDs and names, see Update Test Execution Status.

executionWorkflowStatus

The Jira workflow status of the test execution. Typically, null.

executedOn

String. Specifies the date and time of the test execution.

executedOnVal

A number that encodes the execution date and time. Can be helpful in automated processing.

executedBy

The Jira ID of the user who started the test execution.

executedByDisplay

String. The name of the user who started the test execution.

comment

The test execution’s comment in the plain text format. This comment is visible, for example, in the Details view of the cycle or folder, or on the view page of a Test issue in the Test Executions section.

htmlComment

The test execution’s comment in the HTML format. See above for information on how to view the comment.

cycleId

Number. The ID of the test cycle to which the test execution belongs.

cycleName

String. The name of the test cycle to which the test execution belongs.

folderId

Number. The ID of the folder to which the test execution belongs.

folderName

String. The name of the folder to which the test execution belongs.

versionId

Number. The ID of the project version to which the test execution belongs (version or release). -1 means no version is used.

versionName

String. The name of the project version to which the test execution belongs (version or release).

projectId

Number. The Jira ID of the project to which the test execution belongs. Jira uses this ID for its internal operations. Don’t confuse it with the project key (see below).

projectKey

String. The “visible” identifier of the Jira project to which the test execution belongs. Project keys are part of issue keys. For example, in the PROJ-1234 issue key, PROJ is the project key.

createdBy

The Jira ID of the user who created the test execution.

createdByDisplay

String. The name of the Jira user account that created the test execution.

createdByUserName

String. The name of the user who created the test execution.

modifiedBy

The Jira ID of the user who changed properties of the test execution last time.

createdOn

String. Specifies the date and time when the test execution was created.

createdOnVal

Number. The encoded date and time of the test execution creation.

issueId

Number. The Jira ID of the Test issue to which the test execution corresponds (see Adding Tests to Test Cycles). Typically, this ID is used internally. In the UI, you refer Jira items by their keys (see below).

issueKey

Number. The key of the Test issue to which the test execution corresponds. Issue keys typically look like PROJ-1234.

summary

The Summary field value of the Test issue.

issueDescription

The value of the Description field of the Test issue.

label

The labels of the Test issue.

component

The value of the Components field of the Test issue.

canViewIssue,

isIssueEstimateNil,

isExecutionWorkflowEnabled,

isTimeTrackingEnabled,

Boolean values that reflect attributes of the Test issue to which the test execution corresponds. These values are for internal use.

defects

An array of JSON objects that has information on Jira items linked to the test execution. If the execution has no linked items, the property is absent.

executionDefectCount

The number of Jira items linked to the test execution, but not to its test steps.

stepDefectCount

The number of Jira items linked to all test steps of the test execution.

totalDefectCount

The total number of Jira items linked to the test execution and to its test steps (that is, this number is a sum of stepDefectCount and executionDefectCount).

customFields

A JSON object with the names and values of custom fields the test execution has.

In case of an error, the server typically returns 4xx or 5xx response code. The response body contains the description of the error (with certain exceptions). Here are some examples:

  • If Zephyr has no test execution with the specified ID, the response code will be 400 Bad request, and the response body will contain the error description:

    {
    
    "error": "Execution 1,234,567 is Invalid."
    
    }
  • If the ID is not specified, the response code will be 500 Internal Server Error, and the response body will contain the exception text and call stack.

  • If the request has invalid authentication parameters, the response code is 200 OK, and the response body contains the following:

    {
    
    "errorDesc": "You do not have the permission to make this request. Login Required.",
    
    "errorId": "ERROR"
    
    }

Next steps

go.gifUpdate Test Step Status

go.gifUpdate Test Execution Status

See Also

Zephyr Squad Server REST API

Publication date: