Queries - Search Queries
Searches all queries the user has access to in the current project
GET https://dev.azure.com/{organization}/{project}/_apis/wit/queries?$filter={$filter}&api-version=7.1
GET https://dev.azure.com/{organization}/{project}/_apis/wit/queries?$filter={$filter}&$top={$top}&$expand={$expand}&$includeDeleted={$includeDeleted}&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 |
$filter
|
query | True |
string |
The text to filter the queries with. |
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. |
$expand
|
query | |||
$include
|
query |
boolean |
Include deleted queries and folders |
|
$top
|
query |
integer int32 |
The number of queries to return (Default is 50 and maximum is 200). |
Responses
Name | Type | Description |
---|---|---|
200 OK |
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 | Grants the ability to read work items, queries, boards, area and iterations paths, and other work item tracking related metadata. Also grants the ability to execute queries, search work items and to receive notifications about work item events via service hooks. |
Definitions
Name | Description |
---|---|
Identity |
Describes a reference to an identity. |
Link |
The link query mode. |
Logical |
Logical operator separating the condition clause |
Query |
The expand parameters for queries. Possible options are { None, Wiql, Clauses, All, Minimal } |
Query |
Represents an item in the work item query hierarchy. This can be either a query or a folder. |
Query |
|
Query |
The recursion option for use in a tree query. |
Query |
The type of query. |
Reference |
The class to represent a collection of REST reference links. |
Work |
Describes a work item field operation. |
Work |
Reference to a field in a work item |
Work |
Represents a clause in a work item query. This shows the structure of a work item query. |
Work |
A sort column. |
IdentityReference
Describes a reference to an identity.
Name | Type | Description |
---|---|---|
_links |
This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. |
|
descriptor |
string |
The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. |
directoryAlias |
string |
Deprecated - Can be retrieved by querying the Graph user referenced in the "self" entry of the IdentityRef "_links" dictionary |
displayName |
string |
This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. |
id |
string |
|
imageUrl |
string |
Deprecated - Available in the "avatar" entry of the IdentityRef "_links" dictionary |
inactive |
boolean |
Deprecated - Can be retrieved by querying the Graph membership state referenced in the "membershipState" entry of the GraphUser "_links" dictionary |
isAadIdentity |
boolean |
Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType) |
isContainer |
boolean |
Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType) |
isDeletedInOrigin |
boolean |
|
name |
string |
Legacy back-compat property. This has been the WIT specific value from Constants. Will be hidden (but exists) on the client unless they are targeting the newest version |
profileUrl |
string |
Deprecated - not in use in most preexisting implementations of ToIdentityRef |
uniqueName |
string |
Deprecated - use Domain+PrincipalName instead |
url |
string |
This url is the full route to the source resource of this graph subject. |
LinkQueryMode
The link query mode.
Name | Type | Description |
---|---|---|
linksOneHopDoesNotContain |
string |
Returns work items that satisfy the source, only if no linked work item satisfies the link and target criteria. |
linksOneHopMayContain |
string |
Returns work items that satisfy the source and link criteria, even if no linked work item satisfies the target criteria. |
linksOneHopMustContain |
string |
Returns work items where the source, target, and link criteria are all satisfied. |
linksRecursiveDoesNotContain |
string |
|
linksRecursiveMayContain |
string |
Returns work items a hierarchy of work items that by default satisfy the source |
linksRecursiveMustContain |
string |
|
workItems |
string |
Returns flat list of work items. |
LogicalOperation
Logical operator separating the condition clause
Name | Type | Description |
---|---|---|
and |
string |
|
none |
string |
|
or |
string |
QueryExpand
The expand parameters for queries. Possible options are { None, Wiql, Clauses, All, Minimal }
Name | Type | Description |
---|---|---|
all |
string |
Expands all properties |
clauses |
string |
Expands Columns, Links, ChangeInfo, WIQL text and clauses |
minimal |
string |
Displays minimal properties and the WIQL text |
none |
string |
Expands Columns, Links and ChangeInfo |
wiql |
string |
Expands Columns, Links, ChangeInfo and WIQL text |
QueryHierarchyItem
Represents an item in the work item query hierarchy. This can be either a query or a folder.
Name | Type | Description |
---|---|---|
_links |
Link references to related REST resources. |
|
children |
The child query items inside a query folder. |
|
clauses |
The clauses for a flat query. |
|
columns |
The columns of the query. |
|
createdBy |
The identity who created the query item. |
|
createdDate |
string |
When the query item was created. |
filterOptions |
The link query mode. |
|
hasChildren |
boolean |
If this is a query folder, indicates if it contains any children. |
id |
string |
The id of the query item. |
isDeleted |
boolean |
Indicates if this query item is deleted. Setting this to false on a deleted query item will undelete it. Undeleting a query or folder will not bring back the permission changes that were previously applied to it. |
isFolder |
boolean |
Indicates if this is a query folder or a query. |
isInvalidSyntax |
boolean |
Indicates if the WIQL of this query is invalid. This could be due to invalid syntax or a no longer valid area/iteration path. |
isPublic |
boolean |
Indicates if this query item is public or private. |
lastExecutedBy |
The identity who last ran the query. |
|
lastExecutedDate |
string |
When the query was last run. |
lastModifiedBy |
The identity who last modified the query item. |
|
lastModifiedDate |
string |
When the query item was last modified. |
linkClauses |
The link query clause. |
|
name |
string |
The name of the query item. |
path |
string |
The path of the query item. |
queryRecursionOption |
The recursion option for use in a tree query. |
|
queryType |
The type of query. |
|
sortColumns |
The sort columns of the query. |
|
sourceClauses |
The source clauses in a tree or one-hop link query. |
|
targetClauses |
The target clauses in a tree or one-hop link query. |
|
url |
string |
|
wiql |
string |
The WIQL text of the query |
QueryHierarchyItemsResult
Name | Type | Description |
---|---|---|
count |
integer |
The count of items. |
hasMore |
boolean |
Indicates if the max return limit was hit but there are still more items |
value |
The list of items |
QueryRecursionOption
The recursion option for use in a tree query.
Name | Type | Description |
---|---|---|
childFirst |
string |
Returns work items that satisfy the target criteria, even if no work item satisfies the source and link criteria. |
parentFirst |
string |
Returns work items that satisfy the source, even if no linked work item satisfies the target and link criteria. |
QueryType
The type of query.
Name | Type | Description |
---|---|---|
flat |
string |
Gets a flat list of work items. |
oneHop |
string |
Gets a list of work items and their direct links. |
tree |
string |
Gets a tree of work items showing their link hierarchy. |
ReferenceLinks
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. |
WorkItemFieldOperation
Describes a work item field operation.
Name | Type | Description |
---|---|---|
name |
string |
Friendly name of the operation. |
referenceName |
string |
Reference name of the operation. |
WorkItemFieldReference
Reference to a field in a work item
Name | Type | Description |
---|---|---|
name |
string |
The friendly name of the field. |
referenceName |
string |
The reference name of the field. |
url |
string |
The REST URL of the resource. |
WorkItemQueryClause
Represents a clause in a work item query. This shows the structure of a work item query.
Name | Type | Description |
---|---|---|
clauses |
Child clauses if the current clause is a logical operator |
|
field |
Field associated with condition |
|
fieldValue |
Right side of the condition when a field to field comparison |
|
isFieldValue |
boolean |
Determines if this is a field to field comparison |
logicalOperator |
Logical operator separating the condition clause |
|
operator |
The field operator |
|
value |
string |
Right side of the condition when a field to value comparison |
WorkItemQuerySortColumn
A sort column.
Name | Type | Description |
---|---|---|
descending |
boolean |
The direction to sort by. |
field |
A work item field. |