Temp Queries - Create

Creates a temporary query

Learn more about Work Item Query Language (WIQL) syntax here.

POST https://dev.azure.com/{organization}/{project}/_apis/wit/tempqueries?api-version=7.1

URI Parameters

Name In Required Type Description
organization
path True

string

The name of the Azure DevOps organization.

project
path True

string

Project ID or project name

api-version
query True

string

Version of the API to use. This should be set to '7.1' to use this version of the api.

Request Body

Name Type Description
_links

ReferenceLinks

Link references to related REST resources.

url

string

wiql

string

The WIQL text of the temporary query

Responses

Name Type Description
200 OK

TemporaryQueryResponseModel

successful operation

Security

oauth2

Type: oauth2
Flow: accessCode
Authorization URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL: https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

Scopes

Name Description
vso.work_write Grants the ability to read, create, and update work items and queries, update board metadata, read area and iterations paths other work item tracking related metadata, execute queries, and to receive notifications about work item events via service hooks.

Examples

Create a temporary query

Sample request

POST https://dev.azure.com/{organization}/{project}/_apis/wit/tempqueries?api-version=7.1

{
  "wiql": "Select [System.Id], [System.Title], [System.State] From WorkItems Where [System.WorkItemType] = 'Bug' order by [Microsoft.VSTS.Common.Priority] asc, [System.CreatedDate] desc"
}

Sample response

x-VSS-SenderDeploymentId: 2db76d77-1768-4e9f-8fb8-84255eaacced
persistent-Auth: true
lfs-Authenticate: NTLM
{
  "id": "ac2ed29e-745d-4272-862d-53a2b58e528f"
}

Definitions

Name Description
ReferenceLinks

The class to represent a collection of REST reference links.

TemporaryQueryRequestModel

Describes a request to create a temporary query

TemporaryQueryResponseModel

The result of a temporary query creation.

The class to represent a collection of REST reference links.

Name Type Description
links

object

The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only.

TemporaryQueryRequestModel

Describes a request to create a temporary query

Name Type Description
_links

ReferenceLinks

Link references to related REST resources.

url

string

wiql

string

The WIQL text of the temporary query

TemporaryQueryResponseModel

The result of a temporary query creation.

Name Type Description
id

string

The id of the temporary query item.