I'm using the VSTS REST API to get the iterations of a certain project. What I'm trying to figure out is the "Current iteration".
var vstsConnection = new VssConnection(new Uri(VstsUrl), new VssBasicCredential(string.Empty, VstsPAT));
var witClient = vstsConnection.GetClient<WorkItemTrackingHttpClient>();
//get current iteration in VS
var iterations = witClient.GetClassificationNodeAsync(project: VstsProject, structureGroup: Microsoft.TeamFoundation.WorkItemTracking.WebApi.Models.TreeStructureGroup.Iterations, depth: 5).Result;
// i could iterate over the iterations but i'll just get the first one for now..
var attributes = iterations.Children.FirstOrDefault().Attributes;
Here the attributes give me only the startdate and finishdate. What I'm interested is in the "timeframe" to tell me if it's current or future.
Through calling the https://dev.azure.com/{organization}/{project}/{teamid}/_apis/work/teamsettings/iterations
I do get the 3 fields:
{"count":3,"value":[{"id":"f2ac8484-de34-4d5c-8838-cd388a952257","name":"Iteration 1","path":"Web And Mobile Team - Project Documentation\\Iteration 1","attributes":{"startDate":"2018-12-24T00:00:00Z","finishDate":"2018-12-31T00:00:00Z","timeFrame":"current"},"url":"https://url/_apis/work/teamsettings/iterations/f2ac8484-de34-4d5c-8838-cd388a952257"},{"id":"f57903a8-22e5-474a-a450-a7401a53511e","name":"Iteration 2","path":"Web And Mobile Team - Project Documentation\\Iteration 2","attributes":{"startDate":null,"finishDate":null,"**timeFrame**":"future"},"url":"url/_apis/work/teamsettings/iterations/f57903a8-22e5-474a-a450-a7401a53511e"},{"id":"2cfc4be3-0665-46de-81e0-0302138bd276","name":"Iteration 3","path":"Web And Mobile Team - Project Documentation\\Iteration 3","attributes":{"startDate":null,"finishDate":null,"**timeFrame**":"future"},"url":"url/_apis/work/teamsettings/iterations/2cfc4be3-0665-46de-81e0-0302138bd276"}]}
Any help would be appreciated.