You are not logged in. Click here to log in.

codebeamer Application Lifecycle Management (ALM)

Search In Project

Search inClear

Tags:  not added yet

Test case managementCB:/images/space.gif

This page will explain how tests can be managed using our Swagger API.

We assume that you have already discovered the project structure and you are familiar with the basic tracker item operations.

Test case tracker

The test case tracker is specific tracker with a Testcase type. It will have the same configuration options as other trackers except some specific fields described below.

GET /v3/trackers/{trackerId}

{
  "id": 2323,
  "name": "Test Cases",
  "description": "Test Cases",
  "descriptionFormat": "Wiki",
  "keyName": "TESTCASE",
  "version": 1,
  "createdAt": "2020-11-23T10:40:19.562",
  "createdBy": {
    "id": 1,
    "name": "bond",
    "type": "UserReference"
  },
  "type": {
    "id": 102,
    "name": "Testcase",
    "type": "TrackerTypeReference"
  },
  "deleted": false,
  "hidden": false,
  "usingWorkflow": true,
  "onlyWorkflowCanCreateNewReferringItem": false,
  "usingQuickTransitions": false,
  "defaultShowAncestorItems": false,
  "defaultShowDescendantItems": false,
  "project": {
    "id": 4,
    "name": "Intland Software's Scrum Template",
    "type": "ProjectReference"
  },
  "availableAsTemplate": false
}

Test case specific fields

There are specific fields in a Testcase type tracker which configuration cannot be modified event by the Project Admins.

Pre-Action

This field defines the action needs to be taken before the test execution. It's a basic wiki text field which can contain images, links and special textual formatting.

GET /v3/trackers/{trackerId}/fields/10000

  {
    "id": 10000,
    "name": "Pre-Action",
    "type": "WikiTextField",
    "hidden": false,
    "valueModel": "WikiTextFieldValue",
    "mandatoryInStatuses": [],
    "legacyRestName": "preAction"
  },

Post-Action

This field defines the action needs to be taken after the test execution. It's a basic wiki text field which can contain images, links and special textual formatting.

GET /v3/trackers/{trackerId}/fields/10001

  {
    "id": 10000,
    "name": "Post-Action",
    "type": "WikiTextField",
    "hidden": false,
    "valueModel": "WikiTextFieldValue",
    "mandatoryInStatuses": [],
    "legacyRestName": "postAction"
  },

Test Parameters

A test case can be parameterized in case you'd like to run the same test case with different input. It has a special format described here: Test Parameterisation

GET /v3/trackers/{trackerId}/fields/10002

  {
    "id": 10002,
    "name": "Test Parameters",
    "type": "WikiTextField",
    "hidden": false,
    "valueModel": "WikiTextFieldValue",
    "mandatoryInStatuses": [],
    "legacyRestName": "testParameters"
  },

Reusable

Ti defines if the test case can be reused by other test cases. It's described in detail here: Reference Test Cases and Test Step Reuse

GET /v3/trackers/{trackerId}/fields/10003

  {
    "id": 10003,
    "name": "Reusable",
    "type": "BoolField",
    "hidden": false,
    "valueModel": "BoolFieldValue",
    "mandatoryInStatuses": [
      {
        "id": 0,
        "name": "Unset",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 1,
        "name": "New",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 2,
        "name": "In Design",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 3,
        "name": "Awaiting approval",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 4,
        "name": "Accepted",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 5,
        "name": "Rejected",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 6,
        "name": "Outdated",
        "type": "ChoiceOptionReference"
      }
    ],
    "legacyRestName": "reusable"
  },

Estimated Run Time

A simple duration field which can contain the estimated time for the test to run.

GET /v3/trackers/{trackerId}/fields/10004

  {
    "id": 10004,
    "name": "Estimated Run Time",
    "type": "DurationField",
    "hidden": false,
    "valueModel": "DurationFieldValue",
    "mandatoryInStatuses": [],
    "legacyRestName": "estimatedRunTime"
  },

Test steps

The most important part of the test case. This table field describes the tests need to be executed during the run of the test.

It has three visible columns: Action, Expected result and Critical

There is one extra column which can only be visible in the Swagger API: Id. This value can be used if you want to reference the test step in other test cases.


GET /v3/trackers/{trackerId}/fields/100000

  {
    "id": 1000000,
    "name": "Test Steps",
    "type": "TableField",
    "hidden": false,
    "valueModel": "TableFieldValue",
    "mandatoryInStatuses": [],
    "columns": [
      {
        "id": 1000001,
        "name": "Action",
        "type": "WikiTextField",
        "hidden": false,
        "valueModel": "WikiTextFieldValue",
        "mandatoryInStatuses": [
          {
            "id": 0,
            "name": "Unset",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 1,
            "name": "New",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 2,
            "name": "In Design",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 3,
            "name": "Awaiting approval",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 4,
            "name": "Accepted",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 5,
            "name": "Rejected",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 6,
            "name": "Outdated",
            "type": "ChoiceOptionReference"
          }
        ],
        "legacyRestName": "action"
      },
      {
        "id": 1000002,
        "name": "Expected result",
        "type": "WikiTextField",
        "hidden": false,
        "valueModel": "WikiTextFieldValue",
        "mandatoryInStatuses": [],
        "legacyRestName": "expectedResult"
      },
      {
        "id": 1000003,
        "name": "Critical",
        "type": "BoolField",
        "hidden": false,
        "valueModel": "BoolFieldValue",
        "mandatoryInStatuses": [],
        "legacyRestName": "critical"
      },
      {
        "id": 1000004,
        "name": "Id",
        "type": "WikiTextField",
        "hidden": true,
        "valueModel": "WikiTextFieldValue",
        "mandatoryInStatuses": [],
        "legacyRestName": "id"
      }
    ],
    "legacyRestName": "testSteps"
  }

Test case information

Test cases are basic tracker items so we can retrieve the stored information using GET /v3/items/{testCaseId}.

Alongside the usual tracker item values we will get back the specific test case field values if they are set:

{
  "id": 1133,
  "name": "Simple Test case",
  "description": "Simple Test case description",
  ...
  "customFields": [
    {
      "fieldId": 10000,
      "name": "Pre-Action",
      "value": "Pre-action",
      "type": "WikiTextFieldValue"
    },
    {
      "fieldId": 10001,
      "name": "Post-Action",
      "value": "Post-action",
      "type": "WikiTextFieldValue"
    },
    {
      "fieldId": 10003,
      "name": "Reusable",
      "value": false,
      "type": "BoolFieldValue"
    },
    {
      "fieldId": 1000000,
      "name": "Test Steps",
      "values": [
        [
          {
            "fieldId": 1000001,
            "name": "Action",
            "value": "Action 1",
            "type": "WikiTextFieldValue"
          },
          {
            "fieldId": 1000002,
            "name": "Expected result",
            "value": "Result 1",
            "type": "WikiTextFieldValue"
          },
          {
            "fieldId": 1000003,
            "name": "Critical",
            "value": false,
            "type": "BoolFieldValue"
          },
          {
            "fieldId": 1000004,
            "name": "Id",
            "value": "6cb707334c5297652fbe1a700cb4cb32",
            "type": "WikiTextFieldValue"
          }
        ],
        [
          {
            "fieldId": 1000001,
            "name": "Action",
            "value": "Action 2",
            "type": "WikiTextFieldValue"
          },
          {
            "fieldId": 1000002,
            "name": "Expected result",
            "value": "Result 2",
            "type": "WikiTextFieldValue"
          },
          {
            "fieldId": 1000003,
            "name": "Critical",
            "value": false,
            "type": "BoolFieldValue"
          },
          {
            "fieldId": 1000004,
            "name": "Id",
            "value": "d544c916b3b22cbef43a0aadf48cc6fd",
            "type": "WikiTextFieldValue"
          }
        ]
      ],
      "type": "TableFieldValue"
    }
  ],
  ...
}

Creating a test case

In order to create any tracker item we need to define the mandatory fields on the tracker.

GET /v3/trackers/{trackerId}/schema will return all field definitions and the mandatory fields can be defined as it's described here: Discovering the project structure

Mandatory fields in an Agile-Scrum template project

Priority

Field definition:

  {
    "id": 2,
    "name": "Priority",
    "type": "OptionChoiceField",
    "hidden": false,
    "valueModel": "ChoiceFieldValue<ChoiceOptionReference>",
    "title": "P",
    "mandatoryInStatuses": [],
    "multipleValues": false,
    "options": [
      {
        "id": 0,
        "name": "Unset",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 1,
        "name": "Highest",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 2,
        "name": "High",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 3,
        "name": "Normal",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 4,
        "name": "Low",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 5,
        "name": "Lowest",
        "type": "ChoiceOptionReference"
      }
    ],
    "legacyRestName": "priority",
    "trackerItemField": "priority",
    "referenceType": "ChoiceOptionReference"
  },

This is a built-in field so we can set it's value directly:

{
  "priority": {
    "id": 3,
    "name": "Normal",
    "type": "ChoiceOptionReference"
  },
}

Name

Field definition:

  {
    "id": 3,
    "name": "Name",
    "type": "TextField",
    "hidden": false,
    "valueModel": "TextFieldValue",
    "mandatoryInStatuses": [
      {
        "id": 0,
        "name": "Unset",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 1,
        "name": "New",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 2,
        "name": "In Design",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 3,
        "name": "Awaiting approval",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 4,
        "name": "Accepted",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 5,
        "name": "Rejected",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 6,
        "name": "Outdated",
        "type": "ChoiceOptionReference"
      }
    ],
    "legacyRestName": "name",
    "trackerItemField": "name"
  },

This is a built-in field so we can set it's value directly:

{
  "name": "Simple Test case",
  "priority": {
    "id": 3,
    "name": "Normal",
    "type": "ChoiceOptionReference"
  },
}

Status

Field definition:

  {
    "id": 7,
    "name": "Status",
    "type": "OptionChoiceField",
    "hidden": false,
    "valueModel": "ChoiceFieldValue<ChoiceOptionReference>",
    "mandatoryInStatuses": [],
    "multipleValues": false,
    "options": [
      {
        "id": 0,
        "name": "Unset",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 1,
        "name": "New",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 2,
        "name": "In Design",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 3,
        "name": "Awaiting approval",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 4,
        "name": "Accepted",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 5,
        "name": "Rejected",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 6,
        "name": "Outdated",
        "type": "ChoiceOptionReference"
      }
    ],
    "legacyRestName": "status",
    "trackerItemField": "status",
    "referenceType": "ChoiceOptionReference"
  },

This is a special field as it drives a lot of other features as transitions or permissions.

It can be provided but if there is only one transition from Unset state the system will use the target state automatically.


In case you want to set it explicitly:

{
  "name": "Simple Test case",
  "priority": {
    "id": 3,
    "name": "Normal",
    "type": "ChoiceOptionReference"
  },
  "status": {
    "id": 1,
    "name": "New",
    "type": "ChoiceOptionReference"
  },
  "customFields": [
    {
      "fieldId": 10003,
      "name": "Reusable",
      "value": false,
      "type": "BoolFieldValue"
    }
  ]
}

Reusable

Field definition:

  {
    "id": 10003,
    "name": "Reusable",
    "type": "BoolField",
    "hidden": false,
    "valueModel": "BoolFieldValue",
    "mandatoryInStatuses": [
      {
        "id": 0,
        "name": "Unset",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 1,
        "name": "New",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 2,
        "name": "In Design",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 3,
        "name": "Awaiting approval",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 4,
        "name": "Accepted",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 5,
        "name": "Rejected",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 6,
        "name": "Outdated",
        "type": "ChoiceOptionReference"
      }
    ],
    "legacyRestName": "reusable"
  },

It's a custom field for this specific tracker so we need to use the customFields property:

{
  "name": "Simple Test case",
  "priority": {
    "id": 3,
    "name": "Normal",
    "type": "ChoiceOptionReference"
  },
  "status": {
    "id": 1,
    "name": "New",
    "type": "ChoiceOptionReference"
  },
  "customFields": [
    {
      "fieldId": 10003,
      "name": "Reusable",
      "value": false,
      "type": "BoolFieldValue"
    }
  ]
}

Sending the creation request

POST /v3/trackers/{trackerId}/items

Request body as we constructed:

{
  "name": "Simple Test case",
  "priority": {
    "id": 3,
    "name": "Normal",
    "type": "ChoiceOptionReference"
  },
  "status": {
    "id": 1,
    "name": "New",
    "type": "ChoiceOptionReference"
  },
  "customFields": [
    {
      "fieldId": 10003,
      "name": "Reusable",
      "value": false,
      "type": "BoolFieldValue"
    }
  ]
}

Setting test steps for a test case

Test steps field definition:

  {
    "id": 1000000,
    "name": "Test Steps",
    "type": "TableField",
    "hidden": false,
    "valueModel": "TableFieldValue",
    "mandatoryInStatuses": [],
    "columns": [
      {
        "id": 1000001,
        "name": "Action",
        "type": "WikiTextField",
        "hidden": false,
        "valueModel": "WikiTextFieldValue",
        "mandatoryInStatuses": [
          {
            "id": 0,
            "name": "Unset",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 1,
            "name": "New",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 2,
            "name": "In Design",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 3,
            "name": "Awaiting approval",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 4,
            "name": "Accepted",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 5,
            "name": "Rejected",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 6,
            "name": "Outdated",
            "type": "ChoiceOptionReference"
          }
        ],
        "legacyRestName": "action"
      },
      {
        "id": 1000002,
        "name": "Expected result",
        "type": "WikiTextField",
        "hidden": false,
        "valueModel": "WikiTextFieldValue",
        "mandatoryInStatuses": [],
        "legacyRestName": "expectedResult"
      },
      {
        "id": 1000003,
        "name": "Critical",
        "type": "BoolField",
        "hidden": false,
        "valueModel": "BoolFieldValue",
        "mandatoryInStatuses": [],
        "legacyRestName": "critical"
      },
      {
        "id": 1000004,
        "name": "Id",
        "type": "WikiTextField",
        "hidden": true,
        "valueModel": "WikiTextFieldValue",
        "mandatoryInStatuses": [],
        "legacyRestName": "id"
      }
    ],
    "legacyRestName": "testSteps"
  }

This is a specific table field so we need to set it as customField:

{
  "name": "Simple Test case",
  "priority": {
    "id": 3,
    "name": "Normal",
    "type": "ChoiceOptionReference"
  },
  "status": {
    "id": 1,
    "name": "New",
    "type": "ChoiceOptionReference"
  },
  "customFields": [
    {
      "fieldId": 10003,
      "name": "Reusable",
      "value": false,
      "type": "BoolFieldValue"
    },
    {
      "fieldId": 1000000,
      "name": "Test Steps",
      "values": [
        [
          {
            "fieldId": 1000001,
            "name": "Action",
            "value": "Action 1",
            "type": "WikiTextFieldValue"
          },
          {
            "fieldId": 1000002,
            "name": "Expected result",
            "value": "Result 1",
            "type": "WikiTextFieldValue"
          },
          {
            "fieldId": 1000003,
            "name": "Critical",
            "value": false,
            "type": "BoolFieldValue"
          },
          {
            "fieldId": 1000004,
            "name": "Id",
            "value": "6cb707334c5297652fbe1a700cb4cb32",
            "type": "WikiTextFieldValue"
          }
        ],
        [
          {
            "fieldId": 1000001,
            "name": "Action",
            "value": "Action 2",
            "type": "WikiTextFieldValue"
          },
          {
            "fieldId": 1000002,
            "name": "Expected result",
            "value": "Result 2",
            "type": "WikiTextFieldValue"
          },
          {
            "fieldId": 1000003,
            "name": "Critical",
            "value": false,
            "type": "BoolFieldValue"
          },
          {
            "fieldId": 1000004,
            "name": "Id",
            "value": "d544c916b3b22cbef43a0aadf48cc6fd",
            "type": "WikiTextFieldValue"
          }
        ]
      ],
      "type": "TableFieldValue"
    }
  ]
}

Setting referenced test steps for a test case

In case the test steps need to be referenced (instead of copied) from another test case we can use a ReferredTestStepFieldValue model in our creational request:

{
  "fieldId": 1000004,
  "name": "Id",
  "referredStepId": "6cb707334c5297652fbe1a700cb4cb32",
  "referredTestCaseId": 628791,
  "type": "ReferredTestStepFieldValue"
}

There are three main properties here:

  • We nee to use the fieldId of the Id field in the Test Steps table (in the default config: 100004)
  • referredTestCaseId will provide the id of the source test case item
  • referredStepId should contain the Id field value in the referred test step row on the source test case

We only need to provide this value in a test step row.

We do NOT provide the "value" property as we'd like to generate a new test step id for our reference step.


This example reuses the two test steps from the item created in the previous section (Setting test steps for a test case):

{
  "name": "Referenced test steps",
  "description": "",
  "customFields": [
    {
      "fieldId": 1000000,
      "name": "Test Steps",
      "values": [
        [
          {
            "fieldId": 1000004,
            "name": "Id",
            "referredStepId": "6cb707334c5297652fbe1a700cb4cb32",
            "referredTestCaseId": 628791,
            "type": "ReferredTestStepFieldValue"
          }
        ],
        [
          {
            "fieldId": 1000004,
            "name": "Id",
            "referredStepId": "d544c916b3b22cbef43a0aadf48cc6fd",
            "referredTestCaseId": 628791,
            "type": "ReferredTestStepFieldValue"
          }
        ]
      ],
      "type": "TableFieldValue"
    }
  ]
}

Test run tracker

The test case tracker is specific tracker with a Testcase type. It will have the same configuration options as other trackers except some specific fields described below.

GET /v3/trackers/{trackerId}

{
  "id": 2368,
  "name": "Test Runs",
  "description": "Test Run",
  "descriptionFormat": "Wiki",
  "keyName": "TESTRUN",
  "version": 1,
  "createdAt": "2020-11-23T10:40:19.562",
  "createdBy": {
    "id": 1,
    "name": "bond",
    "type": "UserReference"
  },
  "type": {
    "id": 9,
    "name": "Testrun",
    "type": "TrackerTypeReference"
  },
  "deleted": false,
  "hidden": false,
  "usingWorkflow": true,
  "onlyWorkflowCanCreateNewReferringItem": false,
  "usingQuickTransitions": false,
  "defaultShowAncestorItems": false,
  "defaultShowDescendantItems": false,
  "project": {
    "id": 4,
    "name": "Intland Software's Scrum Template",
    "type": "ProjectReference"
  },
  "availableAsTemplate": false
}

Test run specific fields

There are specific fields in a Testcase type tracker which configuration cannot be modified event by the Project Admins.

Test Step Results

The most important part of the test run. This table field contains the test step results during the run of the test.

It has five columns: Action, Expected result, Critical, Actual result, Result



GET /v3/trackers/{trackerId}/fields/200000

  {
    "id": 2000000,
    "name": "Test Step Results",
    "type": "TableField",
    "hidden": false,
    "valueModel": "TableFieldValue",
    "mandatoryInStatuses": [],
    "columns": [
      {
        "id": 2000001,
        "name": "Action",
        "type": "WikiTextField",
        "hidden": false,
        "valueModel": "WikiTextFieldValue",
        "mandatoryInStatuses": [
          {
            "id": 0,
            "name": "Unset",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 1,
            "name": "In progress",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 2,
            "name": "Suspended",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 4,
            "name": "Finished",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 5,
            "name": "To be approved",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 6,
            "name": "Ready for execution",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 7,
            "name": "Rejected",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 8,
            "name": "Closed",
            "type": "ChoiceOptionReference"
          }
        ],
        "legacyRestName": "action"
      },
      {
        "id": 2000002,
        "name": "Expected result",
        "type": "WikiTextField",
        "hidden": false,
        "valueModel": "WikiTextFieldValue",
        "mandatoryInStatuses": [],
        "legacyRestName": "expectedResult"
      },
      {
        "id": 2000003,
        "name": "Critical",
        "type": "BoolField",
        "hidden": false,
        "valueModel": "BoolFieldValue",
        "mandatoryInStatuses": [],
        "legacyRestName": "critical"
      },
      {
        "id": 2000004,
        "name": "Actual result",
        "type": "WikiTextField",
        "hidden": false,
        "valueModel": "WikiTextFieldValue",
        "mandatoryInStatuses": [],
        "legacyRestName": "actualResult"
      },
      {
        "id": 2000005,
        "name": "Result",
        "type": "TextField",
        "hidden": false,
        "valueModel": "TextFieldValue",
        "mandatoryInStatuses": [],
        "legacyRestName": "result"
      }
    ],
    "legacyRestName": "testStepResults"
  }

Test Cases

This table column contains the corresponding test cases.

It has five columns: Test Case, Active, Stop on Failure, Result



GET /v3/trackers/{trackerId}/fields/100000

  {
    "id": 1000000,
    "name": "Test Cases",
    "type": "TableField",
    "hidden": false,
    "valueModel": "TableFieldValue",
    "mandatoryInStatuses": [
      {
        "id": 0,
        "name": "Unset",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 1,
        "name": "In progress",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 2,
        "name": "Suspended",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 4,
        "name": "Finished",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 5,
        "name": "To be approved",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 6,
        "name": "Ready for execution",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 7,
        "name": "Rejected",
        "type": "ChoiceOptionReference"
      },
      {
        "id": 8,
        "name": "Closed",
        "type": "ChoiceOptionReference"
      }
    ],
    "columns": [
      {
        "id": 1000001,
        "name": "Test Case",
        "type": "TrackerItemChoiceField",
        "hidden": false,
        "valueModel": "ChoiceFieldValue<TrackerItemReference>",
        "mandatoryInStatuses": [
          {
            "id": 0,
            "name": "Unset",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 1,
            "name": "In progress",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 2,
            "name": "Suspended",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 4,
            "name": "Finished",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 5,
            "name": "To be approved",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 6,
            "name": "Ready for execution",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 7,
            "name": "Rejected",
            "type": "ChoiceOptionReference"
          },
          {
            "id": 8,
            "name": "Closed",
            "type": "ChoiceOptionReference"
          }
        ],
        "multipleValues": false,
        "legacyRestName": "testCase",
        "referenceType": "TrackerItemReference"
      },
      {
        "id": 1000002,
        "name": "Active",
        "type": "BoolField",
        "hidden": false,
        "valueModel": "BoolFieldValue",
        "mandatoryInStatuses": [],
        "legacyRestName": "active"
      },
      {
        "id": 1000003,
        "name": "Stop on Failure",
        "type": "BoolField",
        "hidden": false,
        "valueModel": "BoolFieldValue",
        "mandatoryInStatuses": [],
        "legacyRestName": "stopOnFailure"
      },
      {
        "id": 1000004,
        "name": "Result",
        "type": "TextField",
        "hidden": false,
        "valueModel": "TextFieldValue",
        "mandatoryInStatuses": [],
        "legacyRestName": "result"
      }
    ],
    "legacyRestName": "testCases"
  },

Test run information


{
  "id": 1137,
  "name": "Quick Test Run for Simple Test case at Dec 15 2020",
  "description": "",
  "descriptionFormat": "Wiki",
  "createdAt": "2020-12-15T14:14:33.566",
  "createdBy": {
    "id": 1,
    "name": "bond",
    "type": "UserReference"
  },
  "modifiedAt": "2020-12-15T14:14:33.566",
  "modifiedBy": {
    "id": 1,
    "name": "bond",
    "type": "UserReference"
  },
  "version": 1,
  "assignedTo": [],
  "tracker": {
    "id": 2368,
    "name": "Test Runs",
    "type": "TrackerReference"
  },
  "children": [
    {
      "id": 1138,
      "name": "Run of Simple Test case",
      "type": "TrackerItemReference"
    }
  ],
  "customFields": [
    {
      "fieldId": 10000,
      "name": "Sequential",
      "value": false,
      "type": "BoolFieldValue"
    },
    {
      "fieldId": 10002,
      "name": "Run only Accepted TestCases",
      "value": false,
      "type": "BoolFieldValue"
    },
    {
      "fieldId": 1000000,
      "name": "Test Cases",
      "values": [
        [
          {
            "fieldId": 1000001,
            "name": "Test Case",
            "values": [
              {
                "id": 1136,
                "name": "Simple Test case",
                "type": "TrackerItemReference"
              }
            ],
            "type": "ChoiceFieldValue"
          }
        ]
      ],
      "type": "TableFieldValue"
    }
  ],
  "priority": {
    "id": 0,
    "name": "Unset",
    "type": "ChoiceOptionReference"
  },
  "status": {
    "id": 6,
    "name": "Ready for execution",
    "type": "ChoiceOptionReference"
  },
  "platforms": [],
  "subjects": [],
  "resolutions": [],
  "severities": [],
  "formality": {
    "id": 1,
    "name": "Regular",
    "type": "ChoiceOptionReference"
  },
  "versions": [
    {
      "id": 1002,
      "name": "Sprint 1.2",
      "type": "TrackerItemReference"
    }
  ],
  "ordinal": 0,
  "typeName": "Testrun",
  "comments": []
}

Creating a test run

Using proprietary endpoint

The test run item hierarchy is quite complex so we recommend to use this method: POST /v3/trackers/{testRunTrackerId}/testruns

It accepts a list of test sets or test cases and creates a test run which contains all test cases as its children.


Example request body:

{
  "testCaseIds": [
    {
      "id": 1136,
      "name": "Simple Test case",
      "type": "TrackerItemReference"
    },
    {
      "id": 1139,
      "name": "Simple Test case 2",
      "type": "TrackerItemReference"
    }
  ]
}

The result:



Using the tracker item API

We already know every information to create a new test run tracker item but in this case we are responsible to create the child structure.

It can be seen in the previous section: every test case needs to have a properly configured child test run.

Setting test run results

Once an automated test has run we can set the results of the runs using the following endpoint.

PUT /v3/testruns/{testRunId}

Request body:

{
  "updateRequestModels": [
    {
      "testCaseReference": {
        "id": 1136,
        "name": "Simple Test case",
        "type": "TrackerItemReference"
      },
      "result": "PASSED",
      "conclusion": "Successful run",
      "runTime": 10
    },
    {
      "testCaseReference": {
        "id": 1139,
        "name": "Simple Test case 2",
        "type": "TrackerItemReference"
      },
      "result": "FAILED",
      "conclusion": "Failed run",
      "runTime": 20
    }
  ],
  "parentResultPropagation": true
}

The result: