tfstfs-2013

TFS Get all team specific iteration paths


Need help with retrieving all team-specific iteration paths under a specific project. I used this link to get some hint, but with GetTeamConfigurationsForUser, I get only such paths of the teams of which I belong to. Is there a way to get for all teams? Do GetTeamConfigurations work? For example, if I have a project ABC, under which there are 10 teams, I need to get all iteration paths when a specific team is selected (even though I'm not a member of that team as am able to see such in the TFS web mode). Following is the code snippet am currently using:

var project = css.GetProjectFromName(strProjectName);

var allteams = teamService.QueryTeams(strProjectName);
var iterations = new List<string>();

// to get all teams under a project
foreach (TeamFoundationTeam tfteam in allteams)
{
    areaList.Add(tfteam.Name);
}

var configs = teamConfig.GetTeamConfigurationsForUser(new[] { project.Uri.ToString() });

Solution

  • TeamSettingsConfigurationService.GetTeamConfigurationsForUser method get the team settings for teams that the current user/identity is a member of (scoped to a set of team projects)

    You can try to use TeamSettingsConfigurationService.GetTeamConfigurations method which need team IDs

    public IEnumerable<TeamConfiguration> GetTeamConfigurations(
        IEnumerable<Guid> teamIds
    )