Resource: Project Tickets ( /api/project/{projectId}/tickets )

Allows the searching of tickets in external systems

This resource supports the following methods: GET

Methods

GET


Retrieves tickets for a project via a query

Required Permissions

  • TestManagement/View

Supported Expansions

  • ExternalSystem

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.

Example - Search tickets for items matching query

An example of fetching tickets matching a text search.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{projectId}D2FA3402-30FD-4714-BB39-FAA30748BC14Unique ID of Project to find tickets for
qtestText to search for in ticket

Response Headers

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

Response Body

{
  "Skip": 0,
  "Top": 25,
  "Total": 2,
  "Items": [
    {
      "Key": "TST-4629",
      "Summary": "Test windows title clips text on bottom",
      "Url": "https://mycompany.atlassian.net/browse/TST-4629",
      "Id": "18759",
      "Type": "Bug",
      "ExternalSystemId": "c63e805c-e5d3-4919-9d10-a0a500e0754a",
      "ExternalSystemName": "testing",
      "IncidentId": null,
      "Status": "Open",
      "InternalKey": null,
      "Self": "http://localhost/api/externalsystemlink/c63e805c-e5d3-4919-9d10-a0a500e0754a/ticket/18759",
      "Links": [
        {
          "Href": "http://localhost/api/externalsystemlink/c63e805c-e5d3-4919-9d10-a0a500e0754a/ticket/18759/link",
          "Rel": "StartCreateIncident"
        },
        {
          "Href": "http://localhost/api/externalsystemlink/c63e805c-e5d3-4919-9d10-a0a500e0754a",
          "Rel": "ExternalSystemLink"
        }
      ]
    },
    {
      "Key": "TST-2222",
      "Summary": "Re-run selenium tests",
      "Url": "https://mycompany.atlassian.net/browse/TST-2222",
      "Id": "12123",
      "Type": "Task",
      "ExternalSystemId": "c63e805c-e5d3-4919-9d10-a0a500e0754a",
      "ExternalSystemName": "testing",
      "IncidentId": null,
      "Status": "In Progress",
      "InternalKey": null,
      "Self": "http://localhost/api/externalsystemlink/c63e805c-e5d3-4919-9d10-a0a500e0754a/ticket/12123",
      "Links": [
        {
          "Href": "http://localhost/api/externalsystemlink/c63e805c-e5d3-4919-9d10-a0a500e0754a/ticket/12123/link",
          "Rel": "StartCreateIncident"
        },
        {
          "Href": "http://localhost/api/externalsystemlink/c63e805c-e5d3-4919-9d10-a0a500e0754a",
          "Rel": "ExternalSystemLink"
        }
      ]
    }
  ],
  "Self": "http://localhost/api/api/project/D2FA3402-30FD-4714-BB39-FAA30748BC14/tickets?q=test"
}

Status Code

200 - OK

Example - Search tickets for items matching query (with different number of max results)

An example of fetching tickets matching a text search, with a configured maximum number of results.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{projectId}D2FA3402-30FD-4714-BB39-FAA30748BC14Unique ID of Project to find tickets for
qtestText to search for in ticket
$top1Maxmimum number of tickets to return

Response Headers

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

Response Body

{
  "Skip": 0,
  "Top": 1,
  "Total": 1,
  "Items": [
    {
      "Key": "TST-4629",
      "Summary": "Test windows title clips text on bottom",
      "Url": "https://mycompany.atlassian.net/browse/TST-4629",
      "Id": "18759",
      "Type": "Bug",
      "ExternalSystemId": "c63e805c-e5d3-4919-9d10-a0a500e0754a",
      "ExternalSystemName": "testing",
      "IncidentId": null,
      "Status": "Open",
      "InternalKey": null,
      "Self": "http://localhost/api/externalsystemlink/c63e805c-e5d3-4919-9d10-a0a500e0754a/ticket/18759",
      "Links": [
        {
          "Href": "http://localhost/api/externalsystemlink/c63e805c-e5d3-4919-9d10-a0a500e0754a/ticket/18759/link",
          "Rel": "StartCreateIncident"
        },
        {
          "Href": "http://localhost/api/externalsystemlink/c63e805c-e5d3-4919-9d10-a0a500e0754a",
          "Rel": "ExternalSystemLink"
        }
      ]
    }
  ],
  "Self": "http://localhost/api/api/project/D2FA3402-30FD-4714-BB39-FAA30748BC14/tickets?q=test&$top=1"
}

Status Code

200 - OK

  • No labels