Search code examples
tfsserverfoundation

How to build a query in the TFS Query Editor to show stories were in active state for less than 10 minutes


I am using Microsoft Visual Studio Team Foundation Server, Version 16.131.27701.1.

I like to query the stories that are in resolved state but were in an active state for less than 10 minutes. I am using the TFS Query Editor. Does TFS Query editor have a macro for minutes? If not available, then just getting active state for less than a day would be good. I am not sure how to use the [Field] in the operator field to get what I want. TFS query that I have tried

So, looking for a data results that look like this. Basically, looking for stories that close very fast within 10 mins.

Work Item        Activated Date             Resolved Date   
---------------------------------------------------------------  
Story 1      1/1/2019 5:00:00 PM        1/1/2019 5:02:00 PM 
Story 2      1/3/2019 4:00:00 PM        1/3/2019 4:02:00 PM 
Story 3      1/5/2019 3:00:00 PM        1/5/2019 3:05:00 PM 

Can you help?


Solution

  • You can filter for work items by the date on which they were changed or for a specific time period. If you limit the scope of your query, it can help with performance by only returning those results that fit the date range that you want to include.

    However, it can not be precisely to minutes or hours. You could only query items resolved today. For example:

    enter image description here

    If you still want to get those user stories which active state for less than 10 minutes. As a workaround, you could export the query with both Activated Date and Resolved Date columns to Excel. With the help of excel to filter the time between Activated and Closed less than 10 minutes of all user stories.