Sort TFS Query By Itaration Start Date

1.2k views Asked by At

I have TFS/AzureDevOps query which is sorted by Iteration Path . I need to sort it by Iteration Start Date. I dont see any option on the Sorting Page or in the query page to sort like this.

I tried sorting by iteration ID but the iteration were not created in order .

WIQL Code

SELECT
    [System.IterationPath],
    [Prod.Versions],
    [System.Id],
    [Prod.Territory],
    [Prod.Customer],
    [System.Title],
    [System.AssignedTo],
    [System.State]
FROM workitems
WHERE
    [System.TeamProject] = @project
    AND [System.WorkItemType] = 'Feature'
    AND [Prod.Versions] >= '9.0'
    AND [System.IterationPath] <> 'Machine'
    AND [System.AreaPath] UNDER 'Machine\Development'
ORDER BY [System.IterationId],
    [System.Id]

i would like it to be ordered like the following (this is from the setting page of the project in AzureDevops Server 2019 ): enter image description here

2

There are 2 answers

1
Brandon McClure On

We have adopted a naming convention for our iterations that uses the start date of the iteration as the name in order to achieve this.

So the iterations are named like: 2019.08.12 2019.08.26

not ideal, and I would love to see a option to include the iteration's start date a column for this very reason. Hopefully we will see a better answer soon.

2
PatrickLu-MSFT On

Sorry, TFS work item query not support to filter Iteration using Start/End Dates.

There is a similar question here: TFS show iteration Start and End Date on PBI

Since using a name contain iteration date is not a solution for you. As another workaround, you could try get Iterations in specific Start/End dates using TFS API. Some thing maybe helpful for your reference.

Besides, in each collection database there is a table called "tbl_nodes" that holds the start-date and the end-date. Writing a warehouse adapter that actually picks up these dates and saves them to the warehouse. Note do not write or change anything directly in database which may lose official support.

For query work item using Iteration Start/End Dates scenario, please submit it to User Voice site at: https://developercommunity.visualstudio.com/spaces/21/visual-studio-team-services.html?type=idea Microsoft engineers will evaluate any feature request seriously.