Work Item Query Macros in Azure DevOps

Dave Lloyd
ObjectSharp (a Centrilogic Company)
4 min readJul 2, 2019

--

Work item queries have been one of the most useful tools in Azure DevOps since the beginning. They are how we manage and track work outside the Backlog/Kanban and Sprint Boards. The work item query has evolved a great deal since the beginning (2005). Over the years Microsoft has added various Macros that help us create more powerful queries. In case you have not stayed current, here is a list of the available macros as of the end of June 2019.

Users

The first one I’ll mention is the very useful @Me macro which gets replaced with the currently logged in user. So we can write queries that can be user specific yet shared with everyone.

	WorkItemType 	= 	Task
and State = Todo
and Assigned To = @Me

Dates

@Today was a great addition, allowing us to create queries relative to today. So when you want to know if there are any bugs more than 30 days old just add this clause to your query.

	WorkItemType 	= 	Bug 
and Created Date <= @Today — 30

A bunch of other date related macros have been added, including @StartOfDay, @StartOfWeek, @StartOfMonth and @StartOfYear

So if you wanted to know what has been closed this month so far you could use this query:

Closed Date 	>=…

--

--

Dave Lloyd
ObjectSharp (a Centrilogic Company)

I have been writing software and teaching/coaching developers for 40 years. I love sharing knowledge and experience.