Queries - Get
检索单个查询及其子查询
GET https://dev.azure.com/{organization}/{project}/_apis/wit/queries/{query}?api-version=7.1-preview.2
GET https://dev.azure.com/{organization}/{project}/_apis/wit/queries/{query}?$expand={$expand}&$depth={$depth}&$includeDeleted={$includeDeleted}&$useIsoDateFormat={$useIsoDateFormat}&api-version=7.1-preview.2
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
organization
|
path | True |
string |
Azure DevOps 组织的名称。 |
project
|
path | True |
string |
项目 ID 或项目名称 |
query
|
path | True |
string |
查询的 ID 或路径。 |
api-version
|
query | True |
string |
要使用的 API 版本。 应将其设置为“7.1-preview.2”才能使用此版本的 API。 |
$depth
|
query |
integer int32 |
在查询的 文件夹中,将子查询和文件夹返回到此深度。 |
|
$expand
|
query |
在结果中包括查询字符串 (wiql) 、子句、查询结果列和排序选项。 |
||
$include
|
query |
boolean |
包括已删除的查询和文件夹 |
|
$use
|
query |
boolean |
DateTime 查询子句将使用符合 ISO 8601 的格式进行格式化 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
成功的操作 |
安全性
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 | 授予读取工作项、查询、板、区域和迭代路径以及其他工作项跟踪相关元数据的能力。 此外,还允许通过服务挂钩执行查询、搜索工作项和接收有关工作项事件的通知。 |
示例
Deleted query by ID |
Flat query with expanded clauses |
Folder by ID |
Folder by Name |
Hierarchical query with expanded clauses |
Query by ID |
Query by Name |
Deleted query by ID
Sample Request
GET https://dev.azure.com/fabrikam/Fabrikam-Fiber-Git/_apis/wit/queries/{query}?$includeDeleted=true&api-version=7.1-preview.2
Sample Response
{
"id": "342f0f44-4069-46b1-a940-3d0468979ceb",
"name": "Active Bugs",
"path": "My Queries/Website/Active Bugs",
"createdBy": {
"displayName": "Jamal Hartnett",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"_links": {
"avatar": {
"href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
}
},
"id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"uniqueName": "fabrikamfiber4@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
},
"createdDate": "2014-03-18T17:18:36.06Z",
"lastModifiedBy": {
"displayName": "Jamal Hartnett",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"_links": {
"avatar": {
"href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
}
},
"id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"uniqueName": "fabrikamfiber4@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
},
"lastModifiedDate": "2014-03-18T17:18:36.06Z",
"lastExecutedBy": {
"displayName": "Jamal Hartnett",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"_links": {
"avatar": {
"href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
}
},
"id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"uniqueName": "fabrikamfiber4@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
},
"lastExecutedDate": "2014-03-18T17:19:36.06Z",
"isDeleted": true,
"isPublic": false,
"_links": {
"self": {
"href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/queries/342f0f44-4069-46b1-a940-3d0468979ceb"
},
"html": {
"href": "https://dev.azure.com/fabrikam/web/qr.aspx?pguid=6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c&qid=342f0f44-4069-46b1-a940-3d0468979ceb"
},
"parent": {
"href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/queries/8a8c8212-15ca-41ed-97aa-1d6fbfbcd581"
},
"wiql": {
"href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/wiql/342f0f44-4069-46b1-a940-3d0468979ceb"
}
},
"url": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/queries/342f0f44-4069-46b1-a940-3d0468979ceb"
}
Flat query with expanded clauses
Sample Request
GET https://dev.azure.com/fabrikam/Fabrikam-Fiber-Git/_apis/wit/queries/{query}?$expand=clauses&api-version=7.1-preview.2
Sample Response
{
"id": "df60fdf6-3b5f-4928-aae8-29ee63df6e31",
"name": "All Bugs",
"path": "Shared Queries/Website team/All Bugs",
"queryType": "flat",
"columns": [
{
"referenceName": "System.Id",
"name": "ID",
"url": "https://dev.azure.com/fabrikam/_apis/wit/fields/System.Id"
},
{
"referenceName": "System.Title",
"name": "Title",
"url": "https://dev.azure.com/fabrikam/_apis/wit/fields/System.Title"
},
{
"referenceName": "System.State",
"name": "State",
"url": "https://dev.azure.com/fabrikam/_apis/wit/fields/System.State"
}
],
"sortColumns": [
{
"field": {
"referenceName": "Microsoft.VSTS.Common.Priority",
"name": "Priority",
"url": "https://dev.azure.com/fabrikam/_apis/wit/fields/Microsoft.VSTS.Common.Priority"
},
"descending": false
},
{
"field": {
"referenceName": "System.CreatedDate",
"name": "Created Date",
"url": "https://dev.azure.com/fabrikam/_apis/wit/fields/System.CreatedDate"
},
"descending": true
}
],
"wiql": "Select [System.Id], [System.Title], [System.State] From WorkItems Where [System.WorkItemType] = 'Bug' order by [Microsoft.VSTS.Common.Priority] asc, [System.CreatedDate] desc",
"isPublic": true,
"clauses": {
"field": {
"referenceName": "System.WorkItemType",
"name": "Work Item Type",
"url": "https://dev.azure.com/fabrikam/_apis/wit/fields/System.WorkItemType"
},
"operator": {
"referenceName": "SupportedOperations.Equals",
"name": "="
},
"value": "Bug"
},
"_links": {
"self": {
"href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/queries/df60fdf6-3b5f-4928-aae8-29ee63df6e31"
},
"html": {
"href": "https://dev.azure.com/fabrikam/web/qr.aspx?pguid=6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c&qid=df60fdf6-3b5f-4928-aae8-29ee63df6e31"
},
"parent": {
"href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/queries/addcb8b3-12d0-4f2c-b6ca-52bb584ae286"
},
"wiql": {
"href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/wiql/df60fdf6-3b5f-4928-aae8-29ee63df6e31"
}
},
"url": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/queries/df60fdf6-3b5f-4928-aae8-29ee63df6e31"
}
Folder by ID
Sample Request
GET https://dev.azure.com/fabrikam/Fabrikam-Fiber-Git/_apis/wit/queries/{query}?api-version=7.1-preview.2
Sample Response
{
"id": "8a8c8212-15ca-41ed-97aa-1d6fbfbcd581",
"name": "Website team",
"path": "Shared Queries/Website team",
"createdBy": {
"displayName": "Jamal Hartnett",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"_links": {
"avatar": {
"href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
}
},
"id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"uniqueName": "fabrikamfiber4@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
},
"createdDate": "2016-06-01T16:58:56.323Z",
"lastModifiedBy": {
"displayName": "Jamal Hartnett",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"_links": {
"avatar": {
"href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
}
},
"id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"uniqueName": "fabrikamfiber4@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
},
"lastModifiedDate": "2016-06-01T16:58:56.323Z",
"isFolder": true,
"hasChildren": true,
"isPublic": true,
"_links": {
"self": {
"href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/queries/8a8c8212-15ca-41ed-97aa-1d6fbfbcd581"
},
"html": {
"href": "https://dev.azure.com/fabrikam/web/qr.aspx?pguid=6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c&qid=8a8c8212-15ca-41ed-97aa-1d6fbfbcd581"
},
"parent": {
"href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/queries/eb5c1e25-9b3e-4416-a833-e500122882c7"
}
},
"url": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/queries/8a8c8212-15ca-41ed-97aa-1d6fbfbcd581"
}
Folder by Name
Sample Request
GET https://dev.azure.com/fabrikam/Fabrikam-Fiber-Git/_apis/wit/queries/{query}?api-version=7.1-preview.2
Sample Response
{
"id": "8a8c8212-15ca-41ed-97aa-1d6fbfbcd581",
"name": "Website team",
"path": "Shared Queries/Website team",
"createdBy": {
"displayName": "Jamal Hartnett",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"_links": {
"avatar": {
"href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
}
},
"id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"uniqueName": "fabrikamfiber4@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
},
"createdDate": "2016-06-01T16:58:56.323Z",
"lastModifiedBy": {
"displayName": "Jamal Hartnett",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"_links": {
"avatar": {
"href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
}
},
"id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"uniqueName": "fabrikamfiber4@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
},
"lastModifiedDate": "2016-06-01T16:58:56.323Z",
"isFolder": true,
"hasChildren": true,
"isPublic": true,
"_links": {
"self": {
"href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/queries/8a8c8212-15ca-41ed-97aa-1d6fbfbcd581"
},
"html": {
"href": "https://dev.azure.com/fabrikam/web/qr.aspx?pguid=6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c&qid=8a8c8212-15ca-41ed-97aa-1d6fbfbcd581"
},
"parent": {
"href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/queries/eb5c1e25-9b3e-4416-a833-e500122882c7"
}
},
"url": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/queries/8a8c8212-15ca-41ed-97aa-1d6fbfbcd581"
}
Hierarchical query with expanded clauses
Sample Request
GET https://dev.azure.com/fabrikam/Fabrikam-Fiber-Git/_apis/wit/queries/{query}?$expand=clauses&api-version=7.1-preview.2
Sample Response
{
"id": "f0ade206-32f8-4360-9254-ad33f906cd2e",
"name": "Active stories with tasks",
"path": "Shared Queries/Website team/Active stories with tasks",
"queryType": "tree",
"columns": [
{
"referenceName": "System.Id",
"name": "ID",
"url": "https://dev.azure.com/fabrikam/_apis/wit/fields/System.Id"
},
{
"referenceName": "System.WorkItemType",
"name": "Work Item Type",
"url": "https://dev.azure.com/fabrikam/_apis/wit/fields/System.WorkItemType"
},
{
"referenceName": "System.Title",
"name": "Title",
"url": "https://dev.azure.com/fabrikam/_apis/wit/fields/System.Title"
},
{
"referenceName": "System.AssignedTo",
"name": "Assigned To",
"url": "https://dev.azure.com/fabrikam/_apis/wit/fields/System.AssignedTo"
},
{
"referenceName": "System.State",
"name": "State",
"url": "https://dev.azure.com/fabrikam/_apis/wit/fields/System.State"
},
{
"referenceName": "System.Tags",
"name": "Tags",
"url": "https://dev.azure.com/fabrikam/_apis/wit/fields/System.Tags"
}
],
"wiql": "SELECT [System.Id],[System.WorkItemType],[System.Title],[System.AssignedTo],[System.State],[System.Tags] FROM WorkItemLinks WHERE ([Source].[System.TeamProject] = @project AND [Source].[System.WorkItemType] = 'Product Backlog Item' AND [Source].[System.State] <> 'Removed') AND ([System.Links.LinkType] = 'System.LinkTypes.Hierarchy-Forward') AND ([Target].[System.WorkItemType] = 'Task') mode(Recursive)",
"isPublic": true,
"linkClauses": {
"logicalOperator": "and",
"clauses": [
{
"field": {
"referenceName": "System.Links.LinkType",
"name": "Link Type",
"url": "https://dev.azure.com/fabrikam/_apis/wit/fields/System.Links.LinkType"
},
"operator": {
"referenceName": "SupportedOperations.Equals",
"name": "="
},
"value": "System.LinkTypes.Hierarchy-Forward"
}
]
},
"filterOptions": "linksRecursiveMayContain",
"sourceClauses": {
"logicalOperator": "and",
"clauses": [
{
"field": {
"referenceName": "System.TeamProject",
"name": "Team Project",
"url": "https://dev.azure.com/fabrikam/_apis/wit/fields/System.TeamProject"
},
"operator": {
"referenceName": "SupportedOperations.Equals",
"name": "="
},
"value": "@project"
},
{
"field": {
"referenceName": "System.WorkItemType",
"name": "Work Item Type",
"url": "https://dev.azure.com/fabrikam/_apis/wit/fields/System.WorkItemType"
},
"operator": {
"referenceName": "SupportedOperations.Equals",
"name": "="
},
"value": "Product Backlog Item"
},
{
"field": {
"referenceName": "System.State",
"name": "State",
"url": "https://dev.azure.com/fabrikam/_apis/wit/fields/System.State"
},
"operator": {
"referenceName": "SupportedOperations.NotEquals",
"name": "<>"
},
"value": "Removed"
}
]
},
"targetClauses": {
"logicalOperator": "and",
"clauses": [
{
"field": {
"referenceName": "System.WorkItemType",
"name": "Work Item Type",
"url": "https://dev.azure.com/fabrikam/_apis/wit/fields/System.WorkItemType"
},
"operator": {
"referenceName": "SupportedOperations.Equals",
"name": "="
},
"value": "Task"
}
]
},
"_links": {
"self": {
"href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/queries/f0ade206-32f8-4360-9254-ad33f906cd2e"
},
"html": {
"href": "https://dev.azure.com/fabrikam/web/qr.aspx?pguid=6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c&qid=f0ade206-32f8-4360-9254-ad33f906cd2e"
},
"parent": {
"href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/queries/addcb8b3-12d0-4f2c-b6ca-52bb584ae286"
},
"wiql": {
"href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/wiql/f0ade206-32f8-4360-9254-ad33f906cd2e"
}
},
"url": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/queries/f0ade206-32f8-4360-9254-ad33f906cd2e"
}
Query by ID
Sample Request
GET https://dev.azure.com/fabrikam/Fabrikam-Fiber-Git/_apis/wit/queries/{query}?api-version=7.1-preview.2
Sample Response
{
"id": "342f0f44-4069-46b1-a940-3d0468979ceb",
"name": "All Bugs",
"path": "Shared Queries/Website team/All Bugs",
"createdBy": {
"displayName": "Jamal Hartnett",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"_links": {
"avatar": {
"href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
}
},
"id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"uniqueName": "fabrikamfiber4@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
},
"createdDate": "2014-03-18T17:18:36.06Z",
"lastModifiedBy": {
"displayName": "Jamal Hartnett",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"_links": {
"avatar": {
"href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
}
},
"id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"uniqueName": "fabrikamfiber4@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
},
"lastModifiedDate": "2014-03-18T17:18:36.06Z",
"lastExecutedBy": {
"displayName": "Jamal Hartnett",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"_links": {
"avatar": {
"href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
}
},
"id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"uniqueName": "fabrikamfiber4@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
},
"lastExecutedDate": "2014-03-18T17:19:36.06Z",
"isPublic": true,
"_links": {
"self": {
"href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/queries/342f0f44-4069-46b1-a940-3d0468979ceb"
},
"html": {
"href": "https://dev.azure.com/fabrikam/web/qr.aspx?pguid=6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c&qid=342f0f44-4069-46b1-a940-3d0468979ceb"
},
"parent": {
"href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/queries/8a8c8212-15ca-41ed-97aa-1d6fbfbcd581"
},
"wiql": {
"href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/wiql/342f0f44-4069-46b1-a940-3d0468979ceb"
}
},
"url": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/queries/342f0f44-4069-46b1-a940-3d0468979ceb"
}
Query by Name
Sample Request
GET https://dev.azure.com/fabrikam/Fabrikam-Fiber-Git/_apis/wit/queries/{query}?api-version=7.1-preview.2
Sample Response
{
"id": "342f0f44-4069-46b1-a940-3d0468979ceb",
"name": "All Bugs",
"path": "Shared Queries/Website team/All Bugs",
"createdBy": {
"displayName": "Jamal Hartnett",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"_links": {
"avatar": {
"href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
}
},
"id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"uniqueName": "fabrikamfiber4@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
},
"createdDate": "2014-03-18T17:18:36.06Z",
"lastModifiedBy": {
"displayName": "Jamal Hartnett",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"_links": {
"avatar": {
"href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
}
},
"id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"uniqueName": "fabrikamfiber4@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
},
"lastModifiedDate": "2014-03-18T17:18:36.06Z",
"lastExecutedBy": {
"displayName": "Jamal Hartnett",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"_links": {
"avatar": {
"href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
}
},
"id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"uniqueName": "fabrikamfiber4@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
},
"lastExecutedDate": "2014-03-18T17:19:36.06Z",
"isPublic": true,
"_links": {
"self": {
"href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/queries/342f0f44-4069-46b1-a940-3d0468979ceb"
},
"html": {
"href": "https://dev.azure.com/fabrikam/web/qr.aspx?pguid=6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c&qid=342f0f44-4069-46b1-a940-3d0468979ceb"
},
"parent": {
"href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/queries/8a8c8212-15ca-41ed-97aa-1d6fbfbcd581"
},
"wiql": {
"href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/wiql/342f0f44-4069-46b1-a940-3d0468979ceb"
}
},
"url": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/queries/342f0f44-4069-46b1-a940-3d0468979ceb"
}
定义
名称 | 说明 |
---|---|
Identity |
描述对标识的引用。 |
Link |
链接查询模式。 |
Logical |
分隔条件子句的逻辑运算符 |
Query |
查询的 expand 参数。 可能的选项包括 { None、Wiql、Clauses、All、Minimal } |
Query |
表示工作项查询层次结构中的项。 这可以是查询或文件夹。 |
Query |
用于树查询的递归选项。 |
Query |
查询的类型。 |
Reference |
表示 REST 引用链接集合的类。 |
Work |
描述工作项字段操作。 |
Work |
对工作项中的字段的引用 |
Work |
表示工作项查询中的子句。 这显示了工作项查询的结构。 |
Work |
排序列。 |
IdentityReference
描述对标识的引用。
名称 | 类型 | 说明 |
---|---|---|
_links |
此字段包含有关图形主题的零个或多个相关链接。 可以调用这些链接来获取有关此图主题的其他关系或更多详细信息。 |
|
descriptor |
string |
描述符是在系统运行时引用图形主题的主要方式。 此字段将唯一标识帐户和组织中的同一图形主题。 |
directoryAlias |
string |
已弃用 - 可通过查询 IdentityRef“_links”字典的“self”条目中引用的 Graph 用户来检索 |
displayName |
string |
这是图形主题的非唯一显示名称。 若要更改此字段,必须在源提供程序中更改其值。 |
id |
string |
|
imageUrl |
string |
已弃用 - 在 IdentityRef“_links”字典的“头像”条目中可用 |
inactive |
boolean |
已弃用 - 可以通过查询 GraphUser“_links”字典的“membershipState”条目中引用的 Graph 成员身份状态来检索 |
isAadIdentity |
boolean |
已弃用 - 可以从描述符的主题类型推断 (描述符.IsAadUserType/Descriptor.IsAadGroupType) |
isContainer |
boolean |
已弃用 - 可以从描述符的主题类型推断 (描述符.IsGroupType) |
isDeletedInOrigin |
boolean |
|
name |
string |
旧版后兼容属性。 这是常量中特定于 WIT 的值。 将隐藏 (但客户端上存在) ,除非它们面向最新版本 |
profileUrl |
string |
已弃用 - 未在 ToIdentityRef 的大多数预先存在的实现中使用 |
uniqueName |
string |
已弃用 - 改用 Domain+PrincipalName |
url |
string |
此 URL 是此图主题的源资源的完整路由。 |
LinkQueryMode
链接查询模式。
名称 | 类型 | 说明 |
---|---|---|
linksOneHopDoesNotContain |
string |
仅当没有链接的工作项满足链接和目标条件时,才返回满足源的工作项。 |
linksOneHopMayContain |
string |
返回满足源和链接条件的工作项,即使没有链接的工作项满足目标条件。 |
linksOneHopMustContain |
string |
返回所有满足源、目标和链接条件的工作项。 |
linksRecursiveDoesNotContain |
string |
|
linksRecursiveMayContain |
string |
返回默认满足源的工作项层次结构的工作项 |
linksRecursiveMustContain |
string |
|
workItems |
string |
返回工作项的平面列表。 |
LogicalOperation
分隔条件子句的逻辑运算符
名称 | 类型 | 说明 |
---|---|---|
and |
string |
|
none |
string |
|
or |
string |
QueryExpand
查询的 expand 参数。 可能的选项包括 { None、Wiql、Clauses、All、Minimal }
名称 | 类型 | 说明 |
---|---|---|
all |
string |
展开所有属性 |
clauses |
string |
展开列、链接、ChangeInfo、WIQL 文本和子句 |
minimal |
string |
显示最小属性和 WIQL 文本 |
none |
string |
展开列、链接和 ChangeInfo |
wiql |
string |
展开列、链接、ChangeInfo 和 WIQL 文本 |
QueryHierarchyItem
表示工作项查询层次结构中的项。 这可以是查询或文件夹。
名称 | 类型 | 说明 |
---|---|---|
_links |
将引用链接到相关的 REST 资源。 |
|
children |
查询文件夹中的子查询项。 |
|
clauses |
平面查询的 子句。 |
|
columns |
查询的列。 |
|
createdBy |
创建查询项的标识。 |
|
createdDate |
string |
创建查询项时。 |
filterOptions |
链接查询模式。 |
|
hasChildren |
boolean |
如果这是查询文件夹,则指示它是否包含任何子级。 |
id |
string |
查询项的 ID。 |
isDeleted |
boolean |
指示是否删除此查询项。 在已删除的查询项上将其设置为 false 将取消删除。 取消删除查询或文件夹不会带回以前应用于该查询或文件夹的权限更改。 |
isFolder |
boolean |
指示这是查询文件夹还是查询。 |
isInvalidSyntax |
boolean |
指示此查询的 WIQL 是否无效。 这可能是由于语法无效或不再有效的区域/迭代路径造成的。 |
isPublic |
boolean |
指示此查询项是公共的还是私有的。 |
lastExecutedBy |
上次运行查询的标识。 |
|
lastExecutedDate |
string |
上次运行查询时。 |
lastModifiedBy |
上次修改查询项的标识。 |
|
lastModifiedDate |
string |
上次修改查询项时。 |
linkClauses |
链接查询子句。 |
|
name |
string |
查询项的名称。 |
path |
string |
查询项的路径。 |
queryRecursionOption |
用于树查询的递归选项。 |
|
queryType |
查询的类型。 |
|
sortColumns |
查询的排序列。 |
|
sourceClauses |
树或单跃点链接查询中的 source 子句。 |
|
targetClauses |
树或单跃点链接查询中的目标子句。 |
|
url |
string |
|
wiql |
string |
查询的 WIQL 文本 |
QueryRecursionOption
用于树查询的递归选项。
名称 | 类型 | 说明 |
---|---|---|
childFirst |
string |
返回满足目标条件的工作项,即使没有工作项满足源和链接条件。 |
parentFirst |
string |
返回满足源的工作项,即使没有链接的工作项满足目标和链接条件。 |
QueryType
查询的类型。
名称 | 类型 | 说明 |
---|---|---|
flat |
string |
获取工作项的平面列表。 |
oneHop |
string |
获取工作项及其直接链接的列表。 |
tree |
string |
获取显示其链接层次结构的工作项树。 |
ReferenceLinks
表示 REST 引用链接集合的类。
名称 | 类型 | 说明 |
---|---|---|
links |
object |
链接的只读视图。 由于引用链接是只读的,因此我们只想将其公开为只读。 |
WorkItemFieldOperation
描述工作项字段操作。
名称 | 类型 | 说明 |
---|---|---|
name |
string |
操作的友好名称。 |
referenceName |
string |
操作的引用名称。 |
WorkItemFieldReference
对工作项中的字段的引用
名称 | 类型 | 说明 |
---|---|---|
name |
string |
字段的友好名称。 |
referenceName |
string |
字段的引用名称。 |
url |
string |
资源的 REST URL。 |
WorkItemQueryClause
表示工作项查询中的子句。 这显示了工作项查询的结构。
名称 | 类型 | 说明 |
---|---|---|
clauses |
如果 current 子句是逻辑运算符,则为子子句 |
|
field |
与条件关联的字段 |
|
fieldValue |
字段与字段比较时条件的右侧 |
|
isFieldValue |
boolean |
确定此字段是否为字段与字段的比较 |
logicalOperator |
分隔条件子句的逻辑运算符 |
|
operator |
字段运算符 |
|
value |
string |
字段与值比较时条件的右侧 |
WorkItemQuerySortColumn
排序列。
名称 | 类型 | 说明 |
---|---|---|
descending |
boolean |
排序依据的方向。 |
field |
工作项域。 |