I have been removing unused releases in TFS 2017, due some of them were created automatically and never used. 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.
Any other suggestion?
Based on my test, you can use the REST API to abandon or delete the release.
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 )
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.
Get release list:
GET http://server:8080/tfs/DefaultCollection/LCTFVCScrum/_apis/Release/releases
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.