1

I am trying to use the Azure DevOps WIQL to pull a list of work items that have change during a particular date range.

I know that you can pull the work items from a certain date till today, but I want to be able to query a range. Doing something like this:

SELECT 
    [System.Id],
    [System.WorkItemType],
    [System.Title],
    [System.State],
    [System.AreaPath],
    [System.IterationPath]
FROM workitems
WHERE System.ChangedDate > '2022-06-10'
AND System.ChangedDate < '2022-06-11'

Will only pull back information if the last change was between those dates, not if any change was done between those dates. i.e. if I created a work item on the 2022-06-10, this query will pull it back, but if I edit it on the 2022-06-13 it will no longer pull back.

Is it possible to query between a date range, if so how?

Jamie Nicholls
  • 55
  • 1
  • 10

1 Answers1

2

According to you description, you could try to use the following date range to show items from last week in Azure DevOps.

Created Date < @StartOfWeek
Created Date > @StartOfWeek - 1

For more date ranges you could refer to: https://learn.microsoft.com/en-us/azure/devops/boards/queries/wiql-syntax?view=azure-devops#----macros

Ging Yuan-MSFT
  • 689
  • 2
  • 6
  • That would only give me the date it was created. What I was trying to do is get a list of work items that have changed between a range. – Jamie Nicholls Jun 21 '22 at 23:00
  • 1
    You could try to list the work items from the specific created date and make the changed date >= created date, but it's also the last update date. [System.CreatedDate] > '2022-06-10' AND [System.ChangedDate] >= [System.CreatedDate] – Ging Yuan-MSFT Jun 22 '22 at 03:40
  • Thanks, will do that and then add additional filtering on the next part of my script – Jamie Nicholls Jun 22 '22 at 04:31