Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Azure DevOps Services | Azure DevOps Server | Azure DevOps Server 2022 | Azure DevOps Server 2020
Use comparison field operators when you want to filter work items by comparing one field's value to another field's value. Common uses include:
- Find work items where the creator differs from the assignee or the closer.
- Find tasks whose Original Estimate is less than the Completed Work.
- Find closed tasks that completed before their Target Date.
Prerequisites
| Category | Requirements |
|---|---|
| Access levels | - To view and run shared queries: Project member. - To add and save a shared query: At least Basic access. |
| Permissions | Contribute permission set to Allow for the folder that you want to add a query to. By default, the Contributors group doesn't have this permission. |
Note
Users with Stakeholder access for a public project have full access to query features just like users with Basic access. For more information, see Stakeholder access quick reference.
| Category | Requirements |
|---|---|
| Access levels | - To view and run shared queries: Project member. - To add and save a shared query: At least Basic access. |
| Permissions | Contribute permission set to Allow for the folder that you want to add a query to. By default, the Contributors group doesn't have this permission. |
Supported data types
You can use the comparison operators — =[Field], <>[Field], >[Field], <[Field], >=[Field], <=[Field] — with the following listed data types. The data type of the left-hand Field and the right-hand Field must match.
- Boolean (supports
=[Field],<>[Field]) - Date/Time
- Double, Integer
- GUID
- Identity
- String (excluding Tags)
Note
Some data type/operator combinations are nonsensical (for example, Title >= [Field] or Assigned To <= [Field]). Validate your comparison to ensure both sides use compatible data types.
Sample filters
Use these example clauses as a starting point. Exact syntax in the Query Editor might vary slightly by client; when in doubt, build the clause in the web Query Editor and verify the saved WIQL.
Work items closed by someone other than the person who created the work item: [Created By] <> [Closed By] AND [State] = 'Closed'
Tasks whose Original Estimate is less than Completed Work: [Original Estimate] < [Completed Work]
Closed tasks completed before their Target Date: [Closed Date] <= [Target Date] AND [State] = 'Closed'
Fields that support field comparison
The table below lists fields that support comparison queries. Not all fields are available for every process or work item type; some require custom fields or process configuration. See the note that follows for customization links.
Note
Not all fields listed are present in every project/process. You can add custom fields and enable them for comparisons. See Add a custom field to a work item type (Inherited process) or Add or modify a field (On-premises XML process).
A
- Acceptance Criteria (Scrum)
- Accepted By
- Accepted Date
- Activated By
- Activated Date
- Activity
- Actual Attendee 1-8 (CMMI)
- Analysis (CMMI)
- Application Launch Instructions
- Application Start Information
- Application Type
- Iteration ID (System)
- Assigned To
- Associated Context
- Associated Context Code
- Associated Context Owner
- Associated Context Type
- Attached File Count
- Automated Test ID (TCM)
- Automated Test Name (TCM)
- Automated Test Storage (TCM)
- Automated Test Type (TCM)
- AutomatedTestId (TCM)
- AutomatedTestName (TCM)
- Automation Status (TCM)
B
C
- Called By (CMMI)
- Called Date (CMMI)
- Changed By (System)
- Changed Date (System)
- Closed By (System)
- Closed Date (System)
- Closed Status
- Closed Status Code
- Closing Comment
- Comment Count
- Comments (CMMI)
- Committed (CMMI)
- Completed Work
- Contingency Plan (CMMI)
- Corrective Action Actual Resolution (CMMI)
- Corrective Action Plan (CMMI)
- Created By (System)
- Created Date (System)
D–F
- Discipline (CMMI)
- Due Date
- Effort
- Escalate (CMMI)
- External Link Count
- Finish Date
- Found In Build (TCM)
- Found In Environment (CMMI)
H
- How Found (CMMI)
- Hyperlink Count
I
- ID (System)
- Impact Assessment (CMMI)
- Impact on Architecture (CMMI)
- Impact on Development (CMMI)
- Impact on Technical Publications (CMMI)
- Impact on Test (CMMI)
- Impact on User Experience (CMMI)
- Integrated in Build (TCM)
- Issue (TCM)
- Iteration ID (System)
J–N
- Justification (CMMI)
- Link Comment (System)
- Link Description (System)
- Local Data Source (TCM)
- Meeting Type (CMMI)
- Minutes (CMMI)
- Mitigation Plan (CMMI)
- Mitigation Triggers (CMMI)
- Node Name (System)
O–Q
- Optional Attendee 1-8 (CMMI)
- Original Estimate
- Parameters (TCM)
- Priority
- Probability (CMMI)
- Proposed Fix (CMMI)
- Purpose (CMMI)
- Query Text (TCM)
R
- Rating
- Reason (System)
- Related Link Count (System)
- Remaining Work
- Remote Link Count (System)
- Repro Steps
- Required Attendee 1-8 (CMMI)
- Requirement Type (CMMI)
- Requires Review (CMMI)
- Requires Test (CMMI)
- Resolution (Scrum)
- Resolved By
- Resolved Date
- Resolved Reason
- Reviewed By
- Reviewed Date
- Rev (System)
- Risk (Agile)
- Root Cause (CMMI)
S
- Severity
- Size (CMMI)
- Stack Rank
- Start Date
- State (System)
- State Change Date
- State Code
- Steps (TCM)
- Steps to Reproduce (TCM)
- Story Points (Agile)
- Subject Matter Expert (CMMI)
- Symptom (CMMI)
- System Info (TCM)
T
- Target Date
- Target Resolve Date (CMMI)
- Task Type (CMMI)
- Team Project (System)
- Test Suite Audit (TCM)
- Test Suite Type (TCM)
- Test Suite Type ID (TCM)
- Time Criticality
- Title (System)
- Triage (CMMI)
U–W
- User Acceptance Test (CMMI)
- Value Area
- Watermark (System)
- Work Item Type (System)
Note
Field-to-field comparison support differs by client. The web Query Editor supports most field comparisons; complex comparisons (for example, some uses of WAS EVER or advanced WIQL expressions) require editing WIQL directly (WIQL Editor extension). When in doubt, build the clause in the web Query Editor and inspect the saved WIQL.
Related content
- 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
REST API
To programmatically interact with queries, see one of these REST API resources:
- Azure DevOps Services REST API Reference
- Queries
- Work item query language
- Fetch work items with queries programmatically
Tip
If you need reference names for WIQL or REST (for example System.IterationId or Microsoft.VSTS.Common.Priority), see Work item fields and attributes.