I am using TFS client side libraries, e.g Microsoft.TeamFoundation.* assemblies... Given that I have an Iteration name, how do I retrieve all the work items that belong to it?
I've tried the following using the Query object:
var uri = new Uri(ConfigurationManager.AppSettings["TfsUri"]);
var tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(uri);
var wiStore = tfs.GetService<WorkItemStore>();
var queryText = "select [System.Id], [System.WorkItemType], [System.Title], [System.AssignedTo], [System.State] from WorkItems where [System.TeamProject] = 'VieroSAT' and [System.State] = 'Dev' order by [System.Id]";
var query = new Query(wiStore, queryText);
but I can't figure out how to limit results by Iteration Name. And I'd much rather return these values using the TFS assemblies, but I can't find the appropriate method.
So my questions...
I don't have a quick way of testing this, but according to msdn, you can use the Under
comparison operator in your query. However, I'm not sure what field you would use in that where clause to compare against the iteration name. Perhaps something like this:
select [System.Id], [System.WorkItemType], [System.Title], [System.AssignedTo], [System.State]
from WorkItems
where
[System.TeamProject] = 'VieroSAT'
and [System.State] = 'Dev'
and [System.IterationPath] Under 'Iteration1'
order by [System.Id]
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