You’ll often see TF237055 when you try to call destroywitd on a type that is currently assigned to a category. Here’s how to get around that.
TF237055: You cannot destroy a work item type that is being used. Verify that the work item type is not being used in any categories. Operation failed.
You need to export your categories, remove the reference to that type and then import the updated categories.
1. Export the categories to a local file.
witadmin exportcategories /collection:[url] /p:"[project]" /f:C:\categories.xml
2. Remove the reference to the type in the categories file
(categories with Scenario type referenced – This is the type I was trying to remove)
(categories with the Scenario type removed – Just deleted that line, but your file may have other references to your type so make sure you remove all references)
3. Import the categories file back into TFS
witadmin importcategories /collection:[url] /p:"[project]" /f:C:\categories.xml
3. Rerun destroywitd
witadmin destroywitd /collection:[url] /p:"[project]" /n:"[type]"