Execute the Test Case

Use the following operation to execute the test case:

POST /flex/services/rest/latest/execution/{ExecutionID}?status={Status}&testerid={UserId}&allExecutions=false&includeanyoneuser=true

Request format

To execute a test case, send a POST request to the following URL:

http://{ZEPHYR-SERVER}/flex/services/rest/latest/execution/{ExecutionID}?status={Status}&testerid={UserId}&allExecutions=false&includeanyoneuser=true

Request body

{
"teststepUpdate": true, 
"teststepStausId": "1", 
"notes":"Added from API" 
}

ExecutionID - you get this value upon assigning the test case to the user.

Status - The execution status. Possible values:

  • 1 - PASS

  • 2 - FAIL

  • 3 - WIP

  • 4 - Blocked

UserID - the ID of the user who will execute the test case.

teststepUpdate (boolean) - If true, the test step will be updated as well.

teststepStatusID - the test step status. Possible values:

  • 1 - PASS

  • 2 - FAIL

  • 3 - WIP

  • 4 - Blocked

Response body

{
    "id": 2000,
    "assignmentDate": "2020-07-17",
    "actualTime": 600,
    "versionId": "1",
    "status": "1",
    "comment": "Added from API",
    "testerId": -10,
    "executedBy": 1,
    "tcrTreeTestcase": {
        "id": 3999,
        "tcrCatalogTreeId": 164,
        "revision": 6,
        "stateFlag": 0,
        "lastModifiedOn": 1594991704000,
        "versionNumber": 1,
        "createDatetime": 1594991704000,
        "createdById": 5,
        "modifiedById": 5,
        "testcase": {
            "customProperties": {},
            "customProcessedProperties": {},
            "id": 1160,
            "name": "Untitled",
            "description": "",
            "lastModifiedOn": 1594991314000,
            "creationDate": 1594969200000,
            "createDatetime": 1594991314000,
            "tcCreationDate": "07/17/2020",
            "isComplex": false,
            "estimatedTime": 600,
            "writerId": 0,
            "creatorId": 5,
            "lastUpdaterId": 5,
            "oldId": 0,
            "automated": false,
            "customFieldProcessed": false,
            "customFieldValues": [],
            "testcaseSequence": {
                "seqNumber": 1005
            },
            "testcaseId": 1005,
            "versionNumber": 1,
            "projectId": 6,
            "testcaseType": "ORIGINAL",
            "requirementIds": [],
            "requirementIdsNew": [],
            "tcrVersionNumber": 1,
            "tcrTestcaseVersionId": 1160,
            "automatedDefault": false,
            "testcaseShared": false
        },
        "projectId": 6,
        "releaseId": 12,
        "isDerivedFromBDD": false,
        "orderId": 1999,
        "maxVersionNumber": 1,
        "projectIdParam": 6,
        "original": false
    },
    "cyclePhaseId": 6,
    "lastTestResult": {
        "id": 41,
        "executionDate": 1594992866114,
        "execDate": "07/17/2020",
        "executionStatus": "1",
        "testerId": 1,
        "releaseTestScheduleId": 2000,
        "createDatetime": 1594992866114,
        "modifiedDatetime": 1594992866114,
        "createdById": 5,
        "modifiedById": 5
    },
    "defects": [],
    "attachmentCount": 0,
    "lastModifiedBy": 5,
    "createdById": 5,
    "lastModifiedOn": 1594992866116,
    "createDatetime": 1594991764000,
    "changeBy": 5
}

See Also

Migration REST API

Publication date: