我們正在轉向基於TFS 2015(更新4)的Web風格構建。通過API獲取關於Web風格構建的信息
我一直能夠使用下面的代碼檢索有關構建的信息,但這並不是檢索通過Web界面創建的新構建。
是否有合理的方法來修改我的代碼以引入遺留構建和新樣式構建?
如果不是,我認爲是時候弄清楚如何使用REST API了。任何提示等效查詢將不勝感激。
TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(new Uri("http://SERVERINFO"));
IBuildServer buildServer = (IBuildServer) tfs.GetService(typeof (IBuildServer));
var buildDetail = buildServer.CreateBuildDetailSpec("*");
buildDetail.MinFinishTime = DateTime.Now.Date.AddDays(-1);
buildDetail.InformationTypes = null;
buildDetail.QueryDeletedOption = QueryDeletedOption.IncludeDeleted;
buildDetail.MaxBuildsPerDefinition = 1; //Only return the most recent of each build type...or comment out to return all builds with this definition
var builds = buildServer.QueryBuilds(buildDetail).Builds.Select(....