Use an index to query quick reference data
Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019
Use this index to quickly access example queries and information on opening, defining, and working with queries. To learn how to use the Query Editor, see Define a query. If you find that your queries take too long to return results, see Define a query/Best practices.
Example queries
You can list work items based on the following criteria...
Keywords, wildcard queries
- Keyword or phrase query with wildcards
- Undefined field value queries
- Empty or not empty HTML field queries
- Category based queries
- Items you're following
- Recent activity work items
Tag based queries
State, reason, or workflow change queries
- Resolved user stories
- Items I resolved in the last week
- Items failing acceptance tests
- Items closed within the last 15 days
- Items removed as they're duplicate
- Items closed and then reactivated
- Stories in the Code/Doing column
- Items in the Expedite swimlane
- Items in a swimlane containing "Test"
Date and iteration-based queries
- Items created in the last 30 days
- Items modified on a specific date
- Items resolved today
- Items closed within a specific time period
- Items whose updated status
- Items closed in the current sprint
Link and attachment count queries
Identity-based queries
- Active items assigned to me
- Closed items that were assigned to me
- Active items assigned to my team
- Items I've modified in the last 30 days
- Items I closed
- Items I resolved in the last week
- Team or group membership queries
- My recent activity work items
Work item count and numeric field queries
- Count of active bugs per developer
- Count of bugs by area and states
- Sum of story points and their status
- Burnup chart of user stories for a sprint
- Sum of remaining work per developer
History, Discussion, and revision-change queries
- History contains a specific word
- History doesn't contain a specific word
- Reactivated items
- Items closed within a time period
- Items you've been associated with
Team focus queries
Build and test field queries
- List bugs and linked test cases
- List automated test cases
- List requirement-based test suites
- List query-based test suites
Other
Query tasks
- Add a query
- Add a query chart
- Add a query chart to a dashboard
- Add a query tile to a dashboard)
- Add query results to a dashboard
- Add a query folder
- Add columns to query results
- Bulk modify query items
- Bulk update existing work items (csv)
- Copy query URL
- Define a clause
- Delete a query or query folder)
- Direct-links query
Operators and macros supported for each data type
The following table indicates the operators and macros available for the different field data types. Each field is associated with a data type. You can find the data type listed in the descriptions of each field, which you can look up using the Work item field index. Operators available for defining a query clause depend on the data type of the field that you select. For more detailed descriptions of data types, operators, and macros, see Query fields, operators, and macros.
Note
The following macros are only supported from the web portal: @CurrentIteration, @CurrentIteration +/- n, @Follows, @MyRecentActivity, @RecentMentions, @RecentProjectActivity, and @TeamAreas. Queries that contain these macros won't work when opened in Visual Studio/Team Explorer, Microsoft Excel, or Microsoft Project.
Data type
Description
Supported operators and macros
Boolean
Supports a True/False value. Query samples: Query by assignment or workflow changes.
= , <> , =[Field] , <>[Field]
DateTime
A date field in which you can specify a variable, such as @Today
or @Today-1
, or a value, such as 1/1/2012. Enter dates in the Date Pattern you set for your personal profile. See Set personal preferences for details.
For query examples, see Query by date or@CurrentIteration.
= , <> , > , < , >= , <= , =[Field], <>[Field], >[Field], <[Field], >=[Field], <=[Field], In, Not In, Was Ever
Macros: @Today
, valid with any DateTime field
Additional macros supported on Azure DevOps 2019 Update 1 and later versions::
@StartOfDay
, @StartOfWeek
, @StartOfMonth
, and @StartOfYear
, valid with any DateTime field
Double
Also referred to as Decimal and includes picklistDouble1. A real number, such as 0.2 or 3.5.
Query examples: Query by numeric fields.
= , <> , > , < , >= , <= , =[Field], <>[Field], >[Field], <[Field], >=[Field], <=[Field], In, Not In, Was Ever
GUID
A character string that represents a unique ID.
= , <> , > , < , >= , <= , =[Field], <>[Field], >[Field], <[Field], >=[Field], <=[Field], In, Not In, Was Ever
History
Custom formatted field used to track historical information and only assigned to the History field.
Query examples: History and auditing.
Contains Words, Does Not Contain Words
HTML
Text strings that support formatted descriptions, such as the Description or Repro Steps fields. These fields are automatically indexed for full-text search when full-text search is available. Query samples: Query by titles, IDs, and rich-text fields.
Contains Words
, Does Not Contain Words
, Is Empty
2, Is Not Empty
2
Identity
A String field that is used to hold a user identity. Query samples: Query by assignment or workflow changes.
= , <> , > , < , >= , <= , =[Field], <>[Field], >[Field], <[Field], >=[Field], <=[Field], Contains, Does Not Contain, In, Not In, In Group, Not In Group, Was Ever
Macros: @me valid for all Identity fields.
Integer
Also includes picklistInteger1. A 32-bit integer that is signed, such as 0, 1, 2, 34.
Query samples: Query by numeric fields
= , <> , > , < , >= , <= , =[Field], <>[Field], >[Field], <[Field], >=[Field], <=[Field], In, Not In, Was Ever
Macros: @Follows
, @MyRecentActivity
, @RecentMentions
, and @RecentProjectActivity
, valid when used with the ID field.
PlainText
Multi-line text strings that support long descriptions and are automatically indexed for full-text search, when full-text search is available.
Query examples: Query by titles, IDs, and rich-text fields.
Contains Words
, Does Not Contain Words
, Is Empty
, Is Not Empty
String
Also includes picklistString1. Short single-line text that can contain up to 255 Unicode characters. String fields support the Title field, picklists (drop-down menus), user accounts, Tags, and other fields.
Query examples: Query by titles, IDs, and rich-text fields and Query by picklist value.
= , <> , > , < , >= , <= , =[Field], <>[Field], >[Field], <[Field], >=[Field], <=[Field], Contains, Does Not Contain, In, Not In, In Group, Not In Group, Was Ever
Macros: [Any]
, valid with the Work Item Type field @Project
, valid with the Team Project field.
TreePath
Field type that supports the Area Path and Iteration Path fields. You define the tree structure for a project—area paths and iteration paths.
Query examples: Query by area or iteration path and Query by date or current iteration.
Under
, Not Under
, =
, <>
, In
, Not In
Macros: @TeamAreas
3, valid with Area Path field
@CurrentIteration
and @CurrentIteration+/- n
4 valid with the Iteration Path field
Note
- The picklist... data types are only assigned to custom fields defined for an inherited process. The Inherited process model is only supported for Azure DevOps Server 2019 and later versions.
- The
Is Empty
andIs Not Empty
operators are supported for Azure DevOps Server 2019 RC2 and later versions. - The
@TeamAreas
macro is supported for Azure Boards and Azure DevOps Server 2019 and later versions. - The
@CurrentIteration +/- n
macro is supported for Azure DevOps Server 2019 and later versions, and only when run from the web portal.
Date and time pattern
The date and time pattern you enter for DateTime fields should match that which you select through your profile. To view or change your selection, see Set user preferences.
Example queries for select fields
The following table lists common query fields and their data type for which sample queries are provided. To determine the data type of a field, see Work item fields and attributes, List field attributes.
A
- Acceptance Criteria (HTML)
- Activated By (Identity)
- Activated Date (DateTime)
- Activity (String)
- Area Path (TreePath)
- Assigned To (Identity)
- Attached File Count (Integer)
- Automated Test Name (String)
- Automated Test Type (String)
B
- Blocked (String)
- Board Column (String)
- Board Column Done (Boolean)
- Board Lane (String)
- Business Value (String)
C
- Changed By (Identity)
- Changed Date (DateTime)
- Closed By (Identity)
- Closed Date (DateTime)
- Comment Count (Integer)
- Committed (String)
- Completed Work (Decimal)
- Created By (Identity)
- Created Date (DateTime)
D-E-F
- Discipline (String)
- Description (HTML)
- Due Date (DateTime)
- Effort (Decimal)
- External Link Count (Integer)
- Finish Date (DateTime)
- Found In Build (String)
H-P
- History (History)
- Hyperlink Count (Integer)
- ID (Integer)
- Integrated in Build (String)
- Iteration Path (TreePath)
- Link Comment (Integer)
- Node Name (String)
- Original Estimate (Decimal)
- Parameters (HTML)
- Priority (Integer)
R
- Reason (String)
- Related Link Count (Integer)
- Remaining Work (Decimal)
- Repro Steps (HTML)
- Resolved By (Identity)
- Resolved Date (DateTime)
- Resolved Reason (String)
- Rev (Integer)
- Revised Date (DateTime)
S
- Severity (String)
- Size (Decimal)
- Stack Rank (Decimal)
- Start Date (DateTime)
- State (String)
- State Change Date (DateTime)
- Steps (HTML)
- Steps to Reproduce (HTML)
- Story Points (Decimal)
- System Info (HTML)
T
- Tags (String)
- Target Date (DateTime)
- Task Type (String)
- Team Project (String)
- Test Suite Type (String)
- Title (System)
- Triage (String)
V-W
- Value Area (String)
- Work Item Type (String)