2016-05-12 87 views
1

使用舊TFS API,它可以訪問已刪除的構建使用下面的代碼:無法訪問已刪除的構建使用TFS 2015年REST API

IBuildDetailSpec buildDetailSpec = buildServer.CreateBuildDetailSpec(m_teamProject, m_buildDefinition); 
buildDetailSpec.BuildNumber = (string.IsNullOrEmpty(m_buildPrefixOverride))? m_buildDefinition + "*" : m_buildPrefixOverride + "*"; 
buildDetailSpec.MaxBuildsPerDefinition = m_maxBuildPerDefinition; 
buildDetailSpec.Status = BuildStatus.All; 
buildDetailSpec.QueryDeletedOption = QueryDeletedOption.IncludeDeleted; 
buildDetailSpec.QueryOrder = BuildQueryOrder.StartTimeDescending; 
buildDetailSpec.InformationTypes = null; 
IBuildQueryResult buildQueryResult = buildServer.QueryBuilds(buildDetailSpec); 

在另一方面,這似乎是不可能查詢同樣的事情根據文檔使用TFS 2015 Update 2(內部部署)REST API。

這是查詢我運行:

http://tfsserver:8080/tfs/defaultcollection/BuildTools/_apis/build/builds?api-version=2.0&definitions=1227 

沒有人管理查詢呢?如果是這樣,怎麼樣?

回答

0

REST API不包括像.NET API IBuildDetailSpec.QueryDeletedOption查詢刪除選項。

當得到一個列表來建立一個構建定義,下面只輸出的REST API構建不會被刪除:

http://tfsserver:8080/tfs/defaultcollection/BuildTools/_apis/build/builds?api-version=2.0&definitions=xx 

您可以考慮在以下網頁提交用戶的聲音:https://visualstudio.uservoice.com/forums/121579-visual-studio-2015

+0

謝謝你確認。我已經張貼在這裏用戶音色:https://visualstudio.uservoice.com/forums/330519-team-services/suggestions/13833075-add-deleted-builds-option-in-the-builds-rest-api-q –