Forum Discussion
Permanently delete more than 20.000 work items from Azure DevOps recycle bin
How do I permanently delete more than 20.000 work items in Azure DevOps recycle bin?
I tried to solve it programmatically via the Azure DevOps REST API:
https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/recyclebin/get-deleted-work-items?view=azure-devops-rest-6.0
However, when using this endpoint, I get the following error message:
{"$id":"1","innerException":null,"message":"VS402337: The number of work items returned exceeds the size limit of 20000. Change the query to return fewer items.","typeName":"Microsoft.TeamFoundation.WorkItemTracking.Server.WorkItemTrackingQueryResultSizeLimitExceededException, Microsoft.TeamFoundation.WorkItemTracking.Server","typeKey":"WorkItemTrackingQueryResultSizeLimitExceededException","errorCode":0,"eventId":3200}
However, the endpoint does not seem to support any query options.
Any ideas?
Kidd_Ip
The problem is not to destroy a specific work item. The problem is how to figure out, which work items (or ids) are in recycle bin.I have implemented the following work around now:
I delete all work items which are within a given range of startWorkItemId and endWorkItemIf, and ignore all failed delete operations. This approach works quite well, but is very slow if the range is huge.
3 Replies
- UdoKnopCopper Contributor
Kidd_Ip
The problem is not to destroy a specific work item. The problem is how to figure out, which work items (or ids) are in recycle bin.I have implemented the following work around now:
I delete all work items which are within a given range of startWorkItemId and endWorkItemIf, and ignore all failed delete operations. This approach works quite well, but is very slow if the range is huge.
- rao67Copper Contributorthis all info that helpfully with me