Resource: Agile Run Step Incidents ( /api/agilerun/{runId}/step/{stepId}/incidents )

Agile Run Step Incidents (collection) resource - used to retrieve a collection of all incidents linked to an agile run step, or to link a new incident to a step.

This resource supports the following methods: GET, POST

Methods

GET


Retrieves list of incidents linked to the agile run step.

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 agile run step.
404 - NotFoundReturned if agile run, step or incident does not exist.

Example - Get all incident links associated with a agile run step

Retrieves all incidents linked to a agile run step.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{runId}b716ac5e-61a3-4394-9b50-a13014129864The unique identifier (GUID) of the agile run.
{stepId}cbd88178-5e33-43b4-8172-01beaf5bdb75The unique identifier (GUID) of the agile run step.

Response Headers

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

Response Body

{
  "Items": [
    {
      "StepId": "cbd88178-5e33-43b4-8172-01beaf5bdb75",
      "RunId": "b716ac5e-61a3-4394-9b50-a13014129864",
      "IncidentId": "0f61b42d-87f9-40b8-89ee-1bc12a6b5dba",
      "Expands": [
        "Incident",
        "Run"
      ],
      "Self": "http://localhost/api/agilerun/b716ac5e-61a3-4394-9b50-a13014129864/step/cbd88178-5e33-43b4-8172-01beaf5bdb75/incident/0f61b42d-87f9-40b8-89ee-1bc12a6b5dba",
      "Links": [
        {
          "Href": "http://localhost/api/incident/0f61b42d-87f9-40b8-89ee-1bc12a6b5dba",
          "Rel": "Incident"
        }
      ]
    },
    {
      "StepId": "cbd88178-5e33-43b4-8172-01beaf5bdb75",
      "RunId": "b716ac5e-61a3-4394-9b50-a13014129864",
      "IncidentId": "24dfb384-2026-487d-b04b-2de429933508",
      "Expands": [
        "Incident",
        "Run"
      ],
      "Self": "http://localhost/api/agilerun/b716ac5e-61a3-4394-9b50-a13014129864/step/cbd88178-5e33-43b4-8172-01beaf5bdb75/incident/24dfb384-2026-487d-b04b-2de429933508",
      "Links": [
        {
          "Href": "http://localhost/api/incident/24dfb384-2026-487d-b04b-2de429933508",
          "Rel": "Incident"
        }
      ]
    }
  ]
}

Status Code

200 - OK

POST


Create agile run step incident link.

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 agile run, step or incident does not exist.

Example - Create a new link

Create a new incident to agile run step link.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{runId}b716ac5e-61a3-4394-9b50-a13014129864The unique identifier (GUID) of the agile run.
{stepId}cbd88178-5e33-43b4-8172-01beaf5bdb75The unique identifier (GUID) of the agile run step.

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

{
  "StepId": "cbd88178-5e33-43b4-8172-01beaf5bdb75",
  "RunId": "b716ac5e-61a3-4394-9b50-a13014129864",
  "IncidentId": "0f61b42d-87f9-40b8-89ee-1bc12a6b5dba",
  "Expands": [
    "Incident",
    "Run"
  ],
  "Self": "http://localhost/api/agilerun/b716ac5e-61a3-4394-9b50-a13014129864/step/cbd88178-5e33-43b4-8172-01beaf5bdb75/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