Search This Blog

Tuesday, January 02, 2007

Get List of Builds for Deleted Build Types

To get a list of builds you can use:

BuildData[] GetListOfBuilds(string teamProject, string buildType)

How to get build types list I have mentions in: How to Get Build Types List.
If you deleted a build type and you want to get list of builds from this type then you need to call GetListOfBuilds with String.Empty as the buildType parameter. This will return a full list of builds for the teamProject.

public BuildData[] GetAllBuilds(string server, string project)
{
TeamFoundationServer tfs = new TeamFoundationServer(server, CredentialCache.DefaultCredentials);
tfs.EnsureAuthenticated();
BuildStore bs = (BuildStore)tfs.GetService(typeof(BuildStore));
return bs.GetListOfBuilds(project, String.Empty);
}

No comments: