Resource: Step Result Incidents ( /api/stepresult/{id}/incidents )

Step Result Incidents (collection) resource - used to retrieve a collection of all incidents linked to a step, or to link a new incident to a step.

Methods

GET


Retrieves list of incidents linked to the step result.

This method supports the OData parameters $filter, $top, $take, $orderby and $inlinecount. See OData Topic for more details.

Required Permissions

  • TestManagement/View

Status Codes

These are the expected status codes returned by the service - in addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).

StatusDescription
200 - OKReturned if the request was completed successfully.
403 - ForbiddenReturned if you do not have permission to view the list of incidents associated with this step result.
404 - NotFoundReturned if step result does not exist.

Example - Get all incident links associated with a step result

Retrieves all incidents linked to a step result.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}0F61B42D-87F9-40B8-89EE-1BC12A6B5DBAThe unique identifier (GUID) of the step result.

Response Headers

KeyValueDescription
Content-Typeapplication/json; charset=utf-8

Response Body

{
  "Items": [
    {
      "StepResultId": "b849f98e-62b2-460c-97ef-49e6c478a3f9",
      "IncidentId": "0f61b42d-87f9-40b8-89ee-1bc12a6b5dba",
      "Expands": [
        "Incident",
        "StepResult"
      ],
      "Self": "http://localhost/api/stepresult/b849f98e-62b2-460c-97ef-49e6c478a3f9/incident/0f61b42d-87f9-40b8-89ee-1bc12a6b5dba",
      "Links": [
        {
          "Href": "http://localhost/api/incident/0f61b42d-87f9-40b8-89ee-1bc12a6b5dba",
          "Rel": "Incident"
        }
      ]
    },
    {
      "StepResultId": "b849f98e-62b2-460c-97ef-49e6c478a3f9",
      "IncidentId": "24dfb384-2026-487d-b04b-2de429933508",
      "Expands": [
        "Incident",
        "StepResult"
      ],
      "Self": "http://localhost/api/stepresult/b849f98e-62b2-460c-97ef-49e6c478a3f9/incident/24dfb384-2026-487d-b04b-2de429933508",
      "Links": [
        {
          "Href": "http://localhost/api/incident/24dfb384-2026-487d-b04b-2de429933508",
          "Rel": "Incident"
        }
      ]
    }
  ]
}

Status Code

200 - OK

POST


Retrieves list of incidents linked to the step result.

Required Permissions

  • TestManagement/ExecuteTests

Status Codes

These are the expected status codes returned by the service - in addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).

StatusDescription
200 - OKReturned if the incident was already linked to this step.
201 - CreatedReturned if link to incident was created successfully.
403 - ForbiddenReturned if insufficient permission to link to this incident.
404 - NotFoundReturned if step result or incident does not exist.

Example - Create a new link

Create a new incident to step result link.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}B849F98E-62B2-460C-97EF-49E6C478A3F9The unique identifier (GUID) of the step result.

Request Body

{
  "StepResultId": null,
  "IncidentId": "0f61b42d-87f9-40b8-89ee-1bc12a6b5dba"
}

Response Headers

KeyValueDescription
Content-Typeapplication/json; charset=utf-8
Locationhttp://localhost/api/stepresult/B849F98E-62B2-460C-97EF-49E6C478A3F9/incident/0F61B42D-87F9-40B8-89EE-1BC12A6B5DBA

Response Body

{
  "StepResultId": "b849f98e-62b2-460c-97ef-49e6c478a3f9",
  "IncidentId": "0f61b42d-87f9-40b8-89ee-1bc12a6b5dba",
  "Expands": [
    "Incident",
    "StepResult"
  ],
  "Self": "http://localhost/api/stepresult/b849f98e-62b2-460c-97ef-49e6c478a3f9/incident/0f61b42d-87f9-40b8-89ee-1bc12a6b5dba",
  "Links": [
    {
      "Href": "http://localhost/api/incident/0f61b42d-87f9-40b8-89ee-1bc12a6b5dba",
      "Rel": "Incident"
    }
  ]
}

Status Code

201 - Created

  • No labels