Temp Queries - Create

创建临时查询

在此处详细了解工作项查询语言 (WIQL) 语法。

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

URI 参数

名称 必需 类型 说明
organization
path True

string

Azure DevOps 组织的名称。

project
path True

string

项目 ID 或项目名称

api-version
query True

string

要使用的 API 版本。 这应设置为“7.1-preview.1”才能使用此版本的 API。

请求正文

名称 类型 说明
_links

ReferenceLinks

链接对相关 REST 资源的引用。

url

string

wiql

string

临时查询的 WIQL 文本

响应

名称 类型 说明
200 OK

TemporaryQueryResponseModel

成功的操作

安全性

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

名称 说明
vso.work_write 授予读取、创建和更新工作项和查询、更新板元数据、读取区域和迭代路径、其他工作项跟踪相关元数据、执行查询以及通过服务挂钩接收有关工作项事件的通知的能力。

示例

Create a temporary query

Sample Request

POST https://dev.azure.com/{organization}/{project}/_apis/wit/tempqueries?api-version=7.1-preview.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"
}

定义

名称 说明
ReferenceLinks

表示 REST 引用链接集合的类。

TemporaryQueryRequestModel

描述创建临时查询的请求

TemporaryQueryResponseModel

临时查询创建的结果。

表示 REST 引用链接集合的类。

名称 类型 说明
links

object

链接的只读视图。 由于引用链接是只读的,因此我们只想将其公开为只读。

TemporaryQueryRequestModel

描述创建临时查询的请求

名称 类型 说明
_links

ReferenceLinks

链接对相关 REST 资源的引用。

url

string

wiql

string

临时查询的 WIQL 文本

TemporaryQueryResponseModel

临时查询创建的结果。

名称 类型 说明
id

string

临时查询项的 ID。