Resource: Incident Comments ( /api/incident/{id}/comments )

Incident comment collection resource, provides the ability to retrieve all or a subset of comments associated with an incident. Currently to add new comments to an incident, you must update the incident and include a 'Comments' child collection (see the Incident resource examples for more details).

This resource supports the following methods: GET

Methods

GET


Retrieves all (or a subset) of an incident's comments.

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 don't have permission to view this incident.
404 - NotFoundReturned if the incident does not exist.

Example - Get all comments

Retrieve a collection of all comments

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}a1f57de4-832f-4986-99e1-f026ea2e026fID of the incident to retrieve the comments for.

Response Headers

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

Response Body

{
  "Items": [
    {
      "Id": "1e401c7a-ae50-45c2-b94e-8227eebac854",
      "Body": "I have updated the priority of this to high, it's affecting all our customers",
      "CreatedById": "25e9dd38-475d-483b-9c50-3fafee0389b7",
      "CreatedByUserName": "joeb",
      "LastUpdatedById": "25e9dd38-475d-483b-9c50-3fafee0389b7",
      "LastUpdatedByUserName": "joeb",
      "CreatedAt": "2012-03-03T21:34:22Z",
      "LastUpdatedAt": "2012-03-03T21:34:22Z",
      "Self": "http://localhost/api/incident/a1f57de4-832f-4986-99e1-f026ea2e026f/comment/1e401c7a-ae50-45c2-b94e-8227eebac854",
      "Links": [
        {
          "Href": "http://localhost/api/user/25e9dd38-475d-483b-9c50-3fafee0389b7",
          "Rel": "CreatedBy"
        },
        {
          "Href": "http://localhost/api/user/25e9dd38-475d-483b-9c50-3fafee0389b7",
          "Rel": "LastUpdatedBy"
        }
      ]
    },
    {
      "Id": "2aa4900c-e022-4abd-9e3b-ed764f286867",
      "Body": "Issue is now resolved in feature branch - requires further testing before being released to production.",
      "CreatedById": "25e9dd38-475d-483b-9c50-3fafee0389b7",
      "CreatedByUserName": "joeb",
      "LastUpdatedById": "25e9dd38-475d-483b-9c50-3fafee0389b7",
      "LastUpdatedByUserName": "joeb",
      "CreatedAt": "2012-04-05T00:11:10Z",
      "LastUpdatedAt": "2012-04-05T00:11:10Z",
      "Self": "http://localhost/api/incident/a1f57de4-832f-4986-99e1-f026ea2e026f/comment/2aa4900c-e022-4abd-9e3b-ed764f286867",
      "Links": [
        {
          "Href": "http://localhost/api/user/25e9dd38-475d-483b-9c50-3fafee0389b7",
          "Rel": "CreatedBy"
        },
        {
          "Href": "http://localhost/api/user/25e9dd38-475d-483b-9c50-3fafee0389b7",
          "Rel": "LastUpdatedBy"
        }
      ]
    }
  ]
}

Status Code

200 - OK

  • No labels