Skip to content

Latest commit

 

History

History
265 lines (230 loc) · 15.1 KB

File metadata and controls

265 lines (230 loc) · 15.1 KB
title Query by field values
titleSuffix Azure Boards
description Learn how to create a query by filtering on field values that are compared to other field values in Azure Boards and Azure DevOps.
ms.custom boards-queries
ms.service azure-devops-boards
ms.author chcomley
author chcomley
ms.topic example-scenario
ai-usage ai-assisted
monikerRange <= azure-devops
ms.date 10/08/2025

Query by field value comparisons

[!INCLUDE version-lt-eq-azure-devops]

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

[!INCLUDE prerequisites-queries]

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).

:::row::: :::column span="1":::

A

B

C

:::row::: :::column span="1":::

D–F

H

I

:::row::: :::column span="1":::

J–N

O–Q

:::row::: :::column span="1":::

R

:::row::: :::column span="1":::

S

:::row::: :::column span="1":::

T

:::row::: :::column span="1":::

U–W

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

[!INCLUDE temp]

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.