How to get all work items in iteration?

I use TFS client-side libraries like Microsoft.TeamFoundation. * assemblysies ... Given that I have an iteration name, how do I get all the work items that belong to it?

I tried the following with a 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 the results to an Iterative name. And I would rather return these values ​​using TFS assemblies, but I cannot find a suitable method.

So my questions are ...

  • How to return a list of all work items in an iteration using only TFS assemblies (for example, without queries).
  • If # 1 is impossible, how to do it, but using a Query object.
+6
source share
1 answer

I have no quick way to check this, but according to msdn you can use the Under comparison operator in your request. However, I'm not sure which field you would use in this where argument to compare with the iteration name. Maybe 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] 
+7
source

Source: https://habr.com/ru/post/955702/


All Articles