LogoDark mode logo
LogoDark mode logo
Contact SupportLoading Light/Dark Toggle

Data sources

data sourcesazure devops pluginusing work item query language

Using Work Item Query Language (WIQL)

To return work items from the Azure DevOps WIQL data streams, you must specify a WIQL query in the data stream parameters.

WIQL is Azure DevOps' native query language for searching work items (including test cases), and lets you filter and retrieve results based on specified criteria such as state, assigned user, tags, iterations, and more.

This SQL-like language can be challenging to work with, as such the following content provides helpful information about writing WIQL queries in SquaredUp and aims to to demystify the query syntax with working examples.

WIQL query to get work items created in the last seven days​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌​‌‍​‌‌‍‍‌‍‍‌‌‌​‌‍‌​‍‍‌‍‍‌‌‍​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍​‍‌​‌‌​‌‌‌‌‍‌​‌‍‍‌‌‍​‍‌‍​‌‍​‌‍‌‌‌‌‍‌​​‍‌‍‍‌‌‍‍‌‌​‌‍‌‌‌‍‍‌‌​​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍‌‍‌‌‍‌‍‌​‌‍‌‌​‌‌​​‌​‍‌‍‌‌‌​‌‍‌‌‌‍‍‌‌​‌‍​‌‌‌​‌‍‍‌‌‍‌‍‍​‍‌‍‍‌‌‍‌​​‌​‍‌​​‍‌‍​‍​‌​​​‌‌‍‌‌​‍​​‌‌​‍‌‌‍‌​​‌‍‌‍‌‍‌‍‌​​‍‌​‌​​‍‌‌‍‌‌‌‍​‍​‍‌​‍​​​​​‍​‌‍​‍​‍‌​​‌‌‍‌‍​​‍​‍​​‌‌‍​‌‌‍‌‍​​‍​‌‌‍​‌‍‌‌‌‍​​‍‌‌​‌‍‌‌​​‌‍‌‌​‌‌‍​‌‌​‍‌‌​‌‍‍‌‌‍​‌‍​‌‍‌‌​‍‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍‌‍‌​‌‍‌​‍‌‌​‌‌‌​​‍‌‌‌‍‍‌‍‌‌‌‍‌​‍‌‌​​‌​‌​​‍‌‌​​‌​‌​​‍‌‌​​‍​​‍​‌‌​​‍​​‍​​​​​‍​​‌​‌‌​​​​​‍​​​‌‍​‍​​‍​‍‌‌​​‍​​‍​‍‌‌​‌‌‌​‌​​‍‍‌‍​‌‍‍​‌‍‍‌‌‍​‌‍‌​‌​‍‌‍‌‌‌‍‍​‍‌‌​‌‌‌​​‍‌‌‌‍‍‌‍‌‌‌‍‌​‍‌‌​​‌​‌​​‍‌‌​​‌​‌​​‍‌‌​​‍​​‍​​​​‌‍​‌‍‌‍​​​‌‍‌‌​‌​​‌​​​​​‌‍​‍‌‍​​‍‌‌​​‍​​‍​‍‌‌​‌‌‌​‌​​‍‍‌‌​‌‍‌‌‌‍​‌‌​​‌‍​‍‌‍​‌‌​‌‍‌‌‌‌‌‌‌​‍‌‍​​‌​‍‌‌​​‍‌​‌‍‌​‌‌​‌‌‌‌‍‌​‌‍‍‌‌‍​‍‌‌​​‍‌​‌‍‌‍​‌‍​‌‍‌‌‌‌‍‌​​‍‌‍‌‍‍‌‌‍‌​​‌​‍‌​​‍‌‍​‍​‌​​​‌‌‍‌‌​‍​​‌‌​‍‌‌‍‌​​‌‍‌‍‌‍‌‍‌​​‍‌​‌​​‍‌‌‍‌‌‌‍​‍​‍‌​‍​​​​​‍​‌‍​‍​‍‌​​‌‌‍‌‍​​‍​‍​​‌‌‍​‌‌‍‌‍​​‍​‌‌‍​‌‍‌‌‌‍​​‍‌‍‌‌​‌‍‌‌​​‌‍‌‌​‌‌‍​‌‌​‍‌‌​‌‍‍‌‌‍​‌‍​‌‍‌‌​‍‌‍‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍‌‍‌​‌‍‌​‍‌‌​‌‌‌​​‍‌‌‌‍‍‌‍‌‌‌‍‌​‍‌‌​​‌​‌​​‍‌‌​​‌​‌​​‍‌‌​​‍​​‍​‌‌​​‍​​‍​​​​​‍​​‌​‌‌​​​​​‍​​​‌‍​‍​​‍​‍‌‌​​‍​​‍​‍‌‌​‌‌‌​‌​​‍‍‌‍​‌‍‍​‌‍‍‌‌‍​‌‍‌​‌​‍‌‍‌‌‌‍‍​‍‌‌​‌‌‌​​‍‌‌‌‍‍‌‍‌‌‌‍‌​‍‌‌​​‌​‌​​‍‌‌​​‌​‌​​‍‌‌​​‍​​‍​​​​‌‍​‌‍‌‍​​​‌‍‌‌​‌​​‌​​​​​‌‍​‍‌‍​​‍‌‌​​‍​​‍​‍‌‌​‌‌‌​‌​​‍‍‌‌​‌‍‌‌‌‍​‌‌​​‍‌‍‌​​‌‍‌‌‌​‍‌​‌​​‌‍‌‌‌‍​‌‌​‌‍‍‌‌‌‍‌‍‌‌​‌‌​​‌‌‌‌‍​‍‌‍​‌‍‍‌‌​‌‍‍​‌‍‌‌‌‍‌​​‍​‍‌‌

Basic syntax

WIQL follows a simplified SQL-like structure:

SELECT [Fields]
  FROM WorkItems
  WHERE [Conditions]
  ORDER BY [Field] [ASC|DESC]

The following table lists the keywords you'll use most when constructing WIQL queries in SquaredUp. See the WIQL syntax reference for more information.

Keyword
Function
SELECT
Specifies which fields to return.
FROM
Indicates the data location. WorkItems is mandatory.
WHERE
Filters the work items based on conditions.
AND / OR
Combines multiple WHERE conditions
ORDER BY
Sorts the result set by a given field in ASC (ascending) or DESC (descending) order.

Field naming conventions

All fields are redefined by Azure DevOps and are case-sensitive in WIQL. You must use the exact internal field names. For example:

Name
WIQL / System Field Name
Title
System.Title
Work Item Type
System.WorkItemType
State
System.State
Assigned To
System.AssignedTo
Created Date
System.CreatedDate
Changed By
System.ChangedBy
Tags
System.Tags
Priority
Microsoft.VSTS.Common.Priority

Examples

The following examples demonstrate some common use cases when WIQL queries and provide working code snippets which you can copy and tweak.

Get tasks assigned to a specific user

Returns all Task work items assigned to the specified user. Helpful for team leads or developers checking their personal work queue.

SELECT [System.Id], [System.Title]
  FROM WorkItems
  WHERE [System.WorkItemType] = 'Task'
    AND [System.AssignedTo] = 'Jane Doe <[email protected]>'

Get work items with a specific tag

Fetches all work items that include the tag UI. This is useful for filtering work items by topic, technology, or feature area.

SELECT [System.Id], [System.Title]
  FROM WorkItems
  WHERE [System.Tags] CONTAINS 'UI'

Get work items created in the last seven days

This query returns any work item created in the last 7 days. Ideal for reporting new incoming work items or backlog grooming.

SELECT [System.Id], [System.Title], [System.CreatedDate]
  FROM WorkItems
  WHERE [System.CreatedDate] >= @Today - 7
  ORDER BY [System.CreatedDate] DESC

Get priority 1 test cases from a project

Finds test cases from the project squaredup that have a priory of 1. Useful to identify important test cases that require action.

SELECT [system.Title]
  FROM workitems 
  WHERE [system.WorkItemType] = 'Test Case' 
    and [priority] = 1 
    and [System.TeamProject] = 'squaredup'

Get unassigned work items with high priority

Finds work items that are not assigned to anyone and have a high priority (1 or 2). Use this to identify important work that still needs to be picked up.

SELECT [System.Id], [System.Title], [Microsoft.VSTS.Common.Priority]
  FROM WorkItems
  WHERE [System.AssignedTo] = ''
    AND [Microsoft.VSTS.Common.Priority] <= 2

Get all active bugs

This query retrieves all work items of type Bug that are currently in the Active state. It orders the results so the most recently created bugs appear first. Use this to monitor ongoing issues.

SELECT [System.Id], [System.Title], [System.State]
  FROM WorkItems
  WHERE [System.WorkItemType] = 'Bug'
    AND [System.State] = 'Active'
  ORDER BY [System.CreatedDate] DESC

Was this article helpful?


Have more questions or facing an issue?
Submit a ticket

On this page

  • Basic syntax
  • Field naming conventions
  • Examples
  • Get tasks assigned to a specific user
  • Get work items with a specific tag
  • Get work items created in the last seven days
  • Get priority 1 test cases from a project
  • Get unassigned work items with high priority
  • Get all active bugs

Footer

Sites

  • SquaredUp
  • SQUAREDUP DS
  • DOWNLOAD
  • COMMUNITY ANSWERS

Quick Links

  • Contact Support
  • Events
  • Careers

Small Print

  • Privacy Policy
  • Terms and Conditions
YoutubeX (Twitter)LinkedInBlueSky

© SquaredUp 2025