Get Test Execution Properties

Applies to Zephyr Squad Server 9.0.1 and 4.8, last modified on September 19, 2022

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

curl --request GET http://15.20.184.119:8089/rest/zapi/latest/execution/1895 ^
     --user "admin:password"

Operation reference

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:

{
  "execution": {
    "id": 1895,
    "orderId": 1523,
    "executionStatus": "1",
    "executionWorkflowStatus": null,
    "executedOn": "22/Oct/21 9:24 PM",
    "executedOnVal": 1634963040000,
    "executedBy": "admin",
    "executedByDisplay": "admin",
    "comment": "",
    "htmlComment": "",
    "cycleId": 178,
    "cycleName": "myCycle",
    "folderId": 379,
    "folderName": "myFolder",
    "versionId": -1,
    "versionName": "Unscheduled",
    "projectId": 10100,
    "createdBy": "JIRAUSER10000",
    "createdByDisplay": "admin",
    "createdByUserName": "admin",
    "modifiedBy": "JIRAUSER10000",
    "createdOn": "22/Oct/21 8:34 PM",
    "createdOnVal": 1634960040000,
    "issueId": 10429,
    "issueKey": "PROJ-6",
    "summary": "Pie Test",
    "label": "Pie",
    "component": "",
    "projectKey": "PROJ",
    "canViewIssue": true,
    "isIssueEstimateNil": true,
    "isExecutionWorkflowEnabled": true,
    "isTimeTrackingEnabled": true,
    "executionDefectCount": 0,
    "stepDefectCount": 0,
    "totalDefectCount": 0,
    "customFields": "{\"4\":{\"customFieldValueId\":28,\"responseMessage\":\"\",\"customFieldId\":4,\"customFieldName\":\"umber\",\"customFieldDisplayName\":null,\"entityId\":1895,\"customFieldType\":\"NUMBER\",\"value\":\"12345\",\"htmlValue\":null,\"entityType\":null,\"selectedOptions\":\"\",\"projectId\":null},\"17\":{\"customFieldValueId\":27,\"responseMessage\":\"\",\"customFieldId\":17,\"customFieldName\":\"select list\",\"customFieldDisplayName\":null,\"entityId\":1895,\"customFieldType\":\"MULTI_SELECT\",\"value\":\"12345, @12345, ABCDE\",\"htmlValue\":null,\"entityType\":null,\"selectedOptions\":\"19,20,21\",\"projectId\":null}}"
  }
}

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

See Also

Zephyr Squad Server REST API

Highlight search results