Resource: Incidents ( /api/incidents )
Incidents collection resource
Root Relation: Incidents
This resource supports the following methods: GET, POST
Methods
GET
Retrieves all (or a subset) of incidents that are visible.
This method supports the TQL query parameters tql, $top, $take and $inlinecount. See TQL Topic for more details.
Required Permissions
- TestManagement/ManageIncidents/View
Supported Expansions
- Widgets
- FieldValues
- Project
- LastComment
- Status
- Priority
- Type
- Resolution
- Components
- FixedVersions
- AffectedVersions
- ExternalSystemLinks
- ExternalKeys
- Comments
- Attachments
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).
Status | Description |
---|---|
200 - OK | Returned if the request was completed successfully. |
403 - Forbidden | Returned if ET would not complete request (normally due to a validation failure or the necessary permissions to complete the request have not been met). |
Retrieves all incidents matching a TQL query.
Request Headers
Key | Value | Description |
---|---|---|
Accept | application/json |
Request Parameters
Key | Value | Description |
---|---|---|
tql | Name ~ 'Report' | The TQL query to execute. |
$top | 5 | Maximum number of results to return (defaults to 25). |
$skip | 0 | Number of results to skip before return the $top number of results matching the query. |
Response Headers
Key | Value | Description |
---|---|---|
Content-Type | application/json; charset=utf-8 |
Response Body
{ "Skip": 0, "Top": 5, "Total": 1, "Items": [ { "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": null, "FixedVersionIds": null, "ComponentIds": null, "ExternalSystemLinkIds": [], "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, "VersionNumber": 0, "HasAttachments": false, "Expands": [ "Widgets", "FieldValues", "Project", "Comments", "ExternalSystemLinks" ], "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" } ] } ], "Self": "http://localhost/api/api/incidents?tql=Name~'Report'&$top=5&$skip=0" }
Status Code
200 - OK
Retrieves all incidents.
Request Headers
Key | Value | Description |
---|---|---|
Accept | application/json |
Request Parameters
Key | Value | Description |
---|---|---|
$top | 5 | Maximum number of results to return (defaults to 25). |
$skip | 0 | Number of results to skip before return the $top number of results matching the query. |
Response Headers
Key | Value | Description |
---|---|---|
Content-Type | application/json; charset=utf-8 |
Response Body
{ "Skip": 0, "Top": 5, "Total": 2, "Items": [ { "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": null, "FixedVersionIds": null, "ComponentIds": null, "ExternalSystemLinkIds": [], "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, "VersionNumber": 0, "HasAttachments": false, "Expands": [ "Widgets", "FieldValues", "Project", "Comments", "ExternalSystemLinks" ], "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" } ] }, { "Id": "4bb709c2-e0e7-4af3-9f60-a045016a9610", "Summary": "Login", "AssignedToId": null, "AssignedTo": null, "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": null, "FixedVersionIds": null, "ComponentIds": null, "ExternalSystemLinkIds": [], "CreatedAt": "2012-03-01T14:04:05Z", "LastUpdatedAt": "2012-03-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, "VersionNumber": 0, "HasAttachments": false, "Expands": [ "Widgets", "FieldValues", "Project", "Comments", "ExternalSystemLinks" ], "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" } ] } ], "Self": "http://localhost/api/api/incidents?$top=5&$skip=0" }
Status Code
200 - OK
POST
Creates a new test incident.
Required Permissions
- TestManagement/ManageIncidents/Edit
Supported Expansions
- Widgets
- FieldValues
- Project
- LastComment
- Status
- Priority
- Type
- Resolution
- Components
- FixedVersions
- AffectedVersions
- ExternalSystemLinks
- ExternalKeys
- Comments
- Attachments
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).
Status | Description |
---|---|
200 - OK | Returned if the request was completed successfully. |
Example of creating a new incident with the minimum required information.
Request Headers
Key | Value | Description |
---|---|---|
Accept | application/json | |
Content-type | application/json |
Request Body
{ "ProjectId": "27dcaff0-1f8a-4dff-b49a-bb3d9f7153b3", "Summary": "My New Incident", "PriorityId": "fe92720f-3fbd-4e49-a3b2-309f6a0a062a", "StatusId": "62daf195-0a65-400f-af4b-7fda3d529acb", "TypeId": "cfe51645-8179-4fe5-ada3-c145a64d0a05", "WidgetValues": null, "FieldValues": null }
Response Headers
Key | Value | Description |
---|---|---|
Location | http://localhost/api/incident/4bb709c2-e0e7-4af3-9f60-a045016a9610 | |
Content-Type | application/json; charset=utf-8 |
Response Body
{ "Id": "4bb709c2-e0e7-4af3-9f60-a045016a9610", "Summary": "My New Incident", "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": null, "FixedVersionIds": null, "ComponentIds": null, "ExternalSystemLinkIds": [], "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, "VersionNumber": 0, "HasAttachments": false, "Expands": [ "Widgets", "FieldValues", "Project", "Comments", "ExternalSystemLinks" ], "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
201 - Created
Example of creating an new 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
Key | Value | Description |
---|---|---|
Accept | application/json | |
Content-type | application/json |
Request Parameters
Key | Value | Description |
---|---|---|
$expand | FieldValues | Expand field (we expand the FieldValues to ensure that they are included in the response to creating a new incident. |
Request Body
{ "TemporaryId": "6cc26034-6514-44e0-907c-8f4f5eaa85b5", "ProjectId": "27dcaff0-1f8a-4dff-b49a-bb3d9f7153b3", "Number": 22, "Summary": "My New Incident", "AssignedToId": "191375f2-ae6e-4b52-8bed-4192e34b6486", "PriorityId": "fe92720f-3fbd-4e49-a3b2-309f6a0a062a", "StatusId": "62daf195-0a65-400f-af4b-7fda3d529acb", "TypeId": "cfe51645-8179-4fe5-ada3-c145a64d0a05", "ResolutionId": "47b4b0cc-22ee-4993-8ed5-ef1dec40a0d2", "Description": "description", "ExternalSystemLinkIds": [ "8fd5de1b-bd94-46db-90e8-d8f24f130f88" ], "Comments": [ { "Body": "This bug needs to be resolved before the next release." } ], "WidgetValues": null, "FieldValues": { "Cycle": "V2.1 Cycle 1" } }
Response Headers
Key | Value | Description |
---|---|---|
Location | http://localhost/api/incident/4bb709c2-e0e7-4af3-9f60-a045016a9610 | |
Content-Type | application/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": null, "FixedVersionIds": null, "ComponentIds": null, "ExternalSystemLinkIds": [ "8fd5de1b-bd94-46db-90e8-d8f24f130f88" ], "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, "VersionNumber": 0, "HasAttachments": true, "Expands": [ "Widgets", "Project" ], "FieldValues": { "Cycle": "V2.1 Cycle 1" }, "Comments": [ { "Id": "36f8985c-040e-44e6-9340-17a5ce68a086", "Body": "This bug needs to be resolved before the next release.", "CreatedById": "191375f2-ae6e-4b52-8bed-4192e34b6486", "CreatedByUserName": "joeb", "LastUpdatedById": "191375f2-ae6e-4b52-8bed-4192e34b6486", "LastUpdatedByUserName": "joeb", "CreatedAt": "2012-02-02T15:05:06Z", "LastUpdatedAt": "0001-01-01T00:00:00Z", "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
201 - Created
Example of creating a new Incident with the link specified by name, using the ExternalSystemLinks property.
Request Headers
Key | Value | Description |
---|---|---|
Accept | application/json | |
Content-type | application/json |
Request Parameters
Key | Value | Description |
---|---|---|
$expand | FieldValues | Expand field (we expand the FieldValues to ensure that they are included in the response to creating a new incident. |
Request Body
{ "TemporaryId": "6cc26034-6514-44e0-907c-8f4f5eaa85b5", "ProjectId": "27dcaff0-1f8a-4dff-b49a-bb3d9f7153b3", "Number": 22, "Summary": "My New Incident", "AssignedToId": "191375f2-ae6e-4b52-8bed-4192e34b6486", "PriorityId": "fe92720f-3fbd-4e49-a3b2-309f6a0a062a", "StatusId": "62daf195-0a65-400f-af4b-7fda3d529acb", "TypeId": "cfe51645-8179-4fe5-ada3-c145a64d0a05", "ResolutionId": "47b4b0cc-22ee-4993-8ed5-ef1dec40a0d2", "Description": "description", "ExternalSystemLinks": [ { "Name": "Jira Bugs" } ], "Comments": [ { "Body": "This bug needs to be resolved before the next release." } ], "WidgetValues": null, "FieldValues": { "Cycle": "V2.1 Cycle 1" } }
Response Headers
Key | Value | Description |
---|---|---|
Location | http://localhost/api/incident/4bb709c2-e0e7-4af3-9f60-a045016a9610 | |
Content-Type | application/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": null, "FixedVersionIds": null, "ComponentIds": null, "ExternalSystemLinkIds": [ "8fd5de1b-bd94-46db-90e8-d8f24f130f88" ], "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, "VersionNumber": 0, "HasAttachments": true, "Expands": [ "Widgets", "Project" ], "FieldValues": { "Cycle": "V2.1 Cycle 1" }, "Comments": [ { "Id": "36f8985c-040e-44e6-9340-17a5ce68a086", "Body": "This bug needs to be resolved before the next release.", "CreatedById": "191375f2-ae6e-4b52-8bed-4192e34b6486", "CreatedByUserName": "joeb", "LastUpdatedById": "191375f2-ae6e-4b52-8bed-4192e34b6486", "LastUpdatedByUserName": "joeb", "CreatedAt": "2012-02-02T15:05:06Z", "LastUpdatedAt": "0001-01-01T00:00:00Z", "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
201 - Created