Query by field value comparisons
Azure Boards | Azure DevOps Server 2019 | TFS 2018 | TFS 2017 | TFS 2015 | TFS 2013
You can create queries based on how one field's value compares to another using the comparison field operators. This is useful to filter work items based on:
- Is the person who created the work item the same as or different than the person assigned to it, or who closed it
- Which Tasks were closed before or after their Target Date.
Supported data types
You can use the comparison field operators—
=[Field], <>[Field], >[Field], <[Field], >=[Field], <=[Field]—with the following field data types. The data type you select for the Field and the Value must match.
- Boolean (supports
- Double, Integer
- String (excluding Tags)
Some combinations of data type and comparison field operator might not make sense to use, such as
Title >=[Field] or
Assigned To <=[Field].
|Filter for||Include these query clauses|
|Work items closed by someone other than the person who created the work item
State = Closed
|Tasks whose Original Estimate is less than Completed Work||
|Closed tasks completed prior to their target date||
State = Closed
Fields that support field comparison
The following table provides an index to those fields that support field comparison queries.
Not all fields listed are supported for all projects or work item types. However, you can customize a process or work item type by adding custom fields which you can use for the purposes of queries and field comparisons. To learn more, see Add a custom field to a work item type (Inheritance process) or Add or modify a field (Online XML process).
- Query index quick reference
- Query by title, ID, or description
- Query by assignment or workflow changes
- Query by date or current iteration
- Query a numeric field
- Query by picklist value
To programmatically interact with queries, see one of these REST API resources:
To programmatically interact with queries, see Query for Bugs, Tasks, and Other Work Items.