This can also be achieved using the work item query language ( WIQL on MSDN ).
With WIQL you can request TFS. I used C #, but I believe that this works with most / all .NET languages.
WorkItemStore workItemStore = (WorkItemStore)projectCollection.GetService(typeof(WorkItemStore));
WorkItemCollection queryResults = workItemStore.Query(
"Select [System.IterationID], [System.IterationPath] " +
"From WorkItems ORDER BY [System.IterationID]");
You can find the specific iterationID by adding a where clause to the query string:
+ " Where [System.IterationPath] = 'Path'");
The request image can be viewed, iterating through them:
foreach (WorkItem workitem in queryResults)
{
Console.WriteLine(workitem.IterationID);
}
source
share