简体   繁体   English

TFS2017中的批量发布删除

[英]Bulk release removal in TFS2017

I have been removing unused releases in TFS 2017, due some of them were created automatically and never used. 我已在TFS 2017中删除未使用的发行版,因为其中一些是自动创建的,从未使用过。 but this task is monkey job. 但这是猴子的工作。 I would like to perform a bulk deletion, or create an script to delete them. 我想执行批量删除,或创建一个脚本来删除它们。

So far, I was checking the REST API but there is no option to abandon or to delete the releases. 到目前为止,我正在检查REST API,但是没有选择放弃或删除发行版。

Any other suggestion? 还有其他建议吗?

Based on my test, you can use the REST API to abandon or delete the release. 根据我的测试,您可以使用REST API放弃或删除发行版。

Abandoning an active release : (Mentioned in the official document) 放弃有效版本 :(在正式文档中提及)

PATCH http://server:8080/tfs/DefaultCollection/LCTFVCScrum/_apis/Release/releases/10?api-version=3.1-preview

{
  "status": "abandoned",
  "manualEnvironments": null,
  "comment": "Abandon the release"
}

Delete the release: (Not mentioned in the official document, tracked with the Fiddler tool ) 删除发行版:(未在官方文档中提及,使用Fiddler工具进行了跟踪)

DELETE http://win-server:8080/tfs/DefaultCollection/LCTFVCScrum/_apis/Release/releases/9?api-version=3.1-preview

Both of them work well. 他们两个都工作良好。

So, you can get the release list first using REST API (to get the release IDs), then create a script to delete the releases with the Release IDs which you want to be deleted. 因此,您可以首先使用REST API获取发布列表(以获取发布ID),然后创建一个脚本以删除具有要删除的发布Release IDsRelease IDs

Get release list: 获取发布列表:

GET http://server:8080/tfs/DefaultCollection/LCTFVCScrum/_apis/Release/releases

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM