Is there a way in TFS in VS2010 to specify that a particular iteration is the current one, and then return that for use in queries similar to the way @Project
works? If not is there a way to do sub-queries in TFS work item queries?
The @CurrentIteration macro references the current team selected in the web portal.
You can use the WIQL syntax to define a query as a hyperlink or when using the Work Item Query Language (REST API). The WIQL syntax supports all functions available through the web portal Query Editor plus a few more. You can specify the fields to return and specify logical grouping of query clauses.
The @StartOfDay refers the time of “00:00:00” of the day that you want to manage rather than the whole day. So the query that you manage is empty. You can use @today to query. Thank you for helping us build a better Azure DevOps.
Looks like Microsoft listened. @CurrentIteration
is being added as a token.
That’s great, of course. When looking to write a query against the current sprint, however, you are in danger of losing sight of unclosed work items in previous sprints. When you reach for @CurrentIteration
, you probably just mean “all unfinished work that has been committed to a sprint.” If you filter to a single sprint, you’ll miss any stragglers you failed to close or move forward from previous sprints.
Consider using the following pattern, where “ScrumOfScrums\Release 1.0.0.0″ is your backlog path, and all of your sprint paths are children to that:
Filter for work items under your backlog iteration node, but not equal to the backlog iteration node. That will give you all items committed to a sprint.
This will also catch any items that weren’t closed in your previous sprints. Since the goal is to close every item in a sprint before moving to the next one, this query pattern will generally be better than using @CurrentIteration
, unless you're looking to find the closed items in the current iteration.
P.S. While this is an old question, it was my top hit when I searched for info on querying the current iteration in TFS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With