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

Incident resource

Methods

DELETE


Delete a incident.

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 request was completed successfully.
403 - ForbiddenReturned if the permissions required to delete the incident have not been met.
404 - NotFoundReturned if incident does not exist.

Example - DELETE

Delete an incident.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}4bb709c2-e0e7-4af3-9f60-a045016a9610Unique identifier of the incident to update.

Response Headers

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

Status Code

200 - OK

GET


Retrieves a single incident by its unique Identifier.

Required Permissions

  • TestManagement/View

Supported Expansions

  • FieldControls
  • FieldValues
  • Project
  • Comments

For more details on expansions, please see the Expand help topic.

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 this incident.
404 - NotFoundReturned if no incident with that identifier exists.

Example - GET

Retrieves incident by its unique identifier

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}4bb709c2-e0e7-4af3-9f60-a045016a9610Unique identifier of the incident to retrieve.

Response Headers

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

Response Body

{
  "Id": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
  "Summary": "Report pagination",
  "AssignedToId": "191375f2-ae6e-4b52-8bed-4192e34b6486",
  "AssignedTo": "joeb",
  "Description": "Check report pagination works correctly",
  "PriorityId": "fe92720f-3fbd-4e49-a3b2-309f6a0a062a",
  "StatusId": "62daf195-0a65-400f-af4b-7fda3d529acb",
  "TypeId": "cfe51645-8179-4fe5-ada3-c145a64d0a05",
  "ResolutionId": "47b4b0cc-22ee-4993-8ed5-ef1dec40a0d2",
  "AffectedVersionIds": [
    "2b86c434-bdfa-467a-a944-1f3ac05a83cb"
  ],
  "FixedVersionIds": [
    "93588d80-b8cd-465a-847c-b14fa2dee0b8",
    "c09e7115-c55f-4899-856c-1b861143f78b"
  ],
  "ComponentIds": [
    "71917512-da95-4a24-9eb9-b7a6ba9f7346"
  ],
  "CreatedAt": "2012-01-01T14:04:05Z",
  "LastUpdatedAt": "2012-02-02T15:05:06Z",
  "CreatedById": "191375f2-ae6e-4b52-8bed-4192e34b6486",
  "CreatedBy": "joeb",
  "LastUpdatedById": "191375f2-ae6e-4b52-8bed-4192e34b6486",
  "LastUpdatedBy": "joeb",
  "ProjectId": "27dcaff0-1f8a-4dff-b49a-bb3d9f7153b3",
  "ProjectName": "Test Project",
  "IncidentNumber": 0,
  "InternalId": null,
  "HasAttachments": false,
  "Expands": [
    "FieldControls",
    "FieldValues",
    "Project",
    "Comments"
  ],
  "Self": "http://localhost/api/incident/4bb709c2-e0e7-4af3-9f60-a045016a9610",
  "Links": [
    {
      "Href": "http://localhost/api/incident/4bb709c2-e0e7-4af3-9f60-a045016a9610/relationships",
      "Rel": "Relationships"
    },
    {
      "Href": "http://localhost/api/incident/4bb709c2-e0e7-4af3-9f60-a045016a9610/allrelationships",
      "Rel": "AllRelationships"
    },
    {
      "Href": "http://localhost/api/incident/4bb709c2-e0e7-4af3-9f60-a045016a9610/comments",
      "Rel": "Comments"
    },
    {
      "Href": "http://localhost/api/project/27dcaff0-1f8a-4dff-b49a-bb3d9f7153b3",
      "Rel": "Project"
    }
  ]
}

Status Code

200 - OK

PUT


Updates an existing incident.

Required Permissions

  • TestManagement/ExecuteTests

Supported Expansions

  • FieldControls
  • FieldValues
  • Project
  • Comments

For more details on expansions, please see the Expand help topic.

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 ET could not complete request (normally due to a validation failure or the necessary permissions to complete the request have not been met).
404 - NotFoundReturned if the incident does not exist.

Example - PUT (rename incident)

Example of renaming a incident.

Request Headers

KeyValueDescription
Acceptapplication/json
Content-typeapplication/json

Request Parameters

KeyValueDescription
{id}4bb709c2-e0e7-4af3-9f60-a045016a9610Unique identifier of the incident to update.

Request Body

{ "Name": "Updated name" }

Response Headers

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

Response Body

{
  "Id": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
  "Summary": "Updated name",
  "AssignedToId": null,
  "AssignedTo": null,
  "Description": null,
  "PriorityId": "fe92720f-3fbd-4e49-a3b2-309f6a0a062a",
  "StatusId": "62daf195-0a65-400f-af4b-7fda3d529acb",
  "TypeId": "cfe51645-8179-4fe5-ada3-c145a64d0a05",
  "ResolutionId": "47b4b0cc-22ee-4993-8ed5-ef1dec40a0d2",
  "AffectedVersionIds": [
    "2b86c434-bdfa-467a-a944-1f3ac05a83cb"
  ],
  "FixedVersionIds": [
    "93588d80-b8cd-465a-847c-b14fa2dee0b8",
    "c09e7115-c55f-4899-856c-1b861143f78b"
  ],
  "ComponentIds": [
    "71917512-da95-4a24-9eb9-b7a6ba9f7346"
  ],
  "CreatedAt": "2012-01-01T14:04:05Z",
  "LastUpdatedAt": "2012-02-02T15:05:06Z",
  "CreatedById": "191375f2-ae6e-4b52-8bed-4192e34b6486",
  "CreatedBy": "joeb",
  "LastUpdatedById": "191375f2-ae6e-4b52-8bed-4192e34b6486",
  "LastUpdatedBy": "joeb",
  "ProjectId": "27dcaff0-1f8a-4dff-b49a-bb3d9f7153b3",
  "ProjectName": "Test Project",
  "IncidentNumber": 0,
  "InternalId": null,
  "HasAttachments": false,
  "Expands": [
    "FieldControls",
    "FieldValues",
    "Project",
    "Comments"
  ],
  "Self": "http://localhost/api/incident/4bb709c2-e0e7-4af3-9f60-a045016a9610",
  "Links": [
    {
      "Href": "http://localhost/api/incident/4bb709c2-e0e7-4af3-9f60-a045016a9610/relationships",
      "Rel": "Relationships"
    },
    {
      "Href": "http://localhost/api/incident/4bb709c2-e0e7-4af3-9f60-a045016a9610/allrelationships",
      "Rel": "AllRelationships"
    },
    {
      "Href": "http://localhost/api/incident/4bb709c2-e0e7-4af3-9f60-a045016a9610/comments",
      "Rel": "Comments"
    },
    {
      "Href": "http://localhost/api/project/27dcaff0-1f8a-4dff-b49a-bb3d9f7153b3",
      "Rel": "Project"
    }
  ]
}

Status Code

200 - OK

Example - PUT (move incident to new package)

Example of moving an incident to a new package.

Request Headers

KeyValueDescription
Acceptapplication/json
Content-typeapplication/json

Request Parameters

KeyValueDescription
{id}4bb709c2-e0e7-4af3-9f60-a045016a9610Unique identifier of the incident to move.

Request Body

{ "PackageId": "daa396d6-ad7d-4acf-a6c5-40551a70f79" }

Response Headers

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

Response Body

{
  "Id": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
  "Summary": "Updated name",
  "AssignedToId": null,
  "AssignedTo": null,
  "Description": null,
  "PriorityId": "fe92720f-3fbd-4e49-a3b2-309f6a0a062a",
  "StatusId": "62daf195-0a65-400f-af4b-7fda3d529acb",
  "TypeId": "cfe51645-8179-4fe5-ada3-c145a64d0a05",
  "ResolutionId": "47b4b0cc-22ee-4993-8ed5-ef1dec40a0d2",
  "AffectedVersionIds": [
    "2b86c434-bdfa-467a-a944-1f3ac05a83cb"
  ],
  "FixedVersionIds": [
    "93588d80-b8cd-465a-847c-b14fa2dee0b8",
    "c09e7115-c55f-4899-856c-1b861143f78b"
  ],
  "ComponentIds": [
    "71917512-da95-4a24-9eb9-b7a6ba9f7346"
  ],
  "CreatedAt": "2012-01-01T14:04:05Z",
  "LastUpdatedAt": "2012-02-02T15:05:06Z",
  "CreatedById": "191375f2-ae6e-4b52-8bed-4192e34b6486",
  "CreatedBy": "joeb",
  "LastUpdatedById": "191375f2-ae6e-4b52-8bed-4192e34b6486",
  "LastUpdatedBy": "joeb",
  "ProjectId": "27dcaff0-1f8a-4dff-b49a-bb3d9f7153b3",
  "ProjectName": "Test Project",
  "IncidentNumber": 0,
  "InternalId": null,
  "HasAttachments": false,
  "Expands": [
    "FieldControls",
    "FieldValues",
    "Project",
    "Comments"
  ],
  "Self": "http://localhost/api/incident/4bb709c2-e0e7-4af3-9f60-a045016a9610",
  "Links": [
    {
      "Href": "http://localhost/api/incident/4bb709c2-e0e7-4af3-9f60-a045016a9610/relationships",
      "Rel": "Relationships"
    },
    {
      "Href": "http://localhost/api/incident/4bb709c2-e0e7-4af3-9f60-a045016a9610/allrelationships",
      "Rel": "AllRelationships"
    },
    {
      "Href": "http://localhost/api/incident/4bb709c2-e0e7-4af3-9f60-a045016a9610/comments",
      "Rel": "Comments"
    },
    {
      "Href": "http://localhost/api/project/27dcaff0-1f8a-4dff-b49a-bb3d9f7153b3",
      "Rel": "Project"
    }
  ]
}

Status Code

200 - OK

Example - PUT (full update)

Example of updating an existing Incident with most fields populated (including custom fields and comments) - Note: when performing a PUT or POST that includes comments, the comments Expand will be automatically applied to the response.

Request Headers

KeyValueDescription
Acceptapplication/json
Content-typeapplication/json

Request Parameters

KeyValueDescription
{id}4bb709c2-e0e7-4af3-9f60-a045016a9610Unique identifier of the incident to update.
$expandFieldValuesExpand field (we expand the FieldValues to ensure we get it back in the response to creating a new incident.

Request Body

{
  "Id": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
  "TemporaryId": "6cc26034-6514-44e0-907c-8f4f5eaa85b5",
  "ProjectId": "27dcaff0-1f8a-4dff-b49a-bb3d9f7153b3",
  "Number": 22,
  "Summary": "Report pagination",
  "AssignedToId": "191375f2-ae6e-4b52-8bed-4192e34b6486",
  "EstimatedDuration": "5m",
  "PriorityId": "fe92720f-3fbd-4e49-a3b2-309f6a0a062a",
  "StatusId": "62daf195-0a65-400f-af4b-7fda3d529acb",
  "TypeId": "cfe51645-8179-4fe5-ada3-c145a64d0a05",
  "Description": "description",
  "Comments": [
    {
      "Body": "This bug also affects grid pagination on some screens."
    }
  ],
  "FieldControlValues": null,
  "FieldValues": {
    "Cycle": "V2.1 Cycle 1"
  }
}

Response Headers

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

Response Body

{
  "Id": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
  "Summary": "My New Incident",
  "AssignedToId": "191375f2-ae6e-4b52-8bed-4192e34b6486",
  "AssignedTo": "joeb",
  "Description": "description",
  "PriorityId": "fe92720f-3fbd-4e49-a3b2-309f6a0a062a",
  "StatusId": "62daf195-0a65-400f-af4b-7fda3d529acb",
  "TypeId": "cfe51645-8179-4fe5-ada3-c145a64d0a05",
  "ResolutionId": "47b4b0cc-22ee-4993-8ed5-ef1dec40a0d2",
  "AffectedVersionIds": [
    "2b86c434-bdfa-467a-a944-1f3ac05a83cb"
  ],
  "FixedVersionIds": [
    "93588d80-b8cd-465a-847c-b14fa2dee0b8",
    "c09e7115-c55f-4899-856c-1b861143f78b"
  ],
  "ComponentIds": [
    "71917512-da95-4a24-9eb9-b7a6ba9f7346"
  ],
  "CreatedAt": "2012-01-01T14:04:05Z",
  "LastUpdatedAt": "2012-02-02T15:05:06Z",
  "CreatedById": "191375f2-ae6e-4b52-8bed-4192e34b6486",
  "CreatedBy": "joeb",
  "LastUpdatedById": "191375f2-ae6e-4b52-8bed-4192e34b6486",
  "LastUpdatedBy": "joeb",
  "ProjectId": "27dcaff0-1f8a-4dff-b49a-bb3d9f7153b3",
  "ProjectName": "Test Project",
  "IncidentNumber": 0,
  "InternalId": null,
  "HasAttachments": true,
  "Expands": [
    "FieldControls",
    "Project"
  ],
  "FieldValues": {
    "Cycle": "V2.1 Cycle 1"
  },
  "Comments": [
    {
      "Id": "36f8985c-040e-44e6-9340-17a5ce68a086",
      "Body": "This bug also affects grid pagination on some screens.",
      "CreatedById": "191375f2-ae6e-4b52-8bed-4192e34b6486",
      "CreatedByUserName": "joeb",
      "TicketCommentId": null,
      "LastUpdatedById": "191375f2-ae6e-4b52-8bed-4192e34b6486",
      "LastUpdatedByUserName": "joeb",
      "CreatedAt": "2012-02-02T15:05:06Z",
      "LastUpdatedAt": "2012-02-02T15:05:06Z",
      "Self": "http://localhost/api/incident/4bb709c2-e0e7-4af3-9f60-a045016a9610/comment/36f8985c-040e-44e6-9340-17a5ce68a086",
      "Links": [
        {
          "Href": "http://localhost/api/user/191375f2-ae6e-4b52-8bed-4192e34b6486",
          "Rel": "CreatedBy"
        },
        {
          "Href": "http://localhost/api/user/191375f2-ae6e-4b52-8bed-4192e34b6486",
          "Rel": "LastUpdatedBy"
        }
      ]
    }
  ],
  "Self": "http://localhost/api/incident/4bb709c2-e0e7-4af3-9f60-a045016a9610",
  "Links": [
    {
      "Href": "http://localhost/api/incident/4bb709c2-e0e7-4af3-9f60-a045016a9610/relationships",
      "Rel": "Relationships"
    },
    {
      "Href": "http://localhost/api/incident/4bb709c2-e0e7-4af3-9f60-a045016a9610/allrelationships",
      "Rel": "AllRelationships"
    },
    {
      "Href": "http://localhost/api/incident/4bb709c2-e0e7-4af3-9f60-a045016a9610/comments",
      "Rel": "Comments"
    },
    {
      "Href": "http://localhost/api/project/27dcaff0-1f8a-4dff-b49a-bb3d9f7153b3",
      "Rel": "Project"
    }
  ]
}

Status Code

200 - OK

  • No labels