TFS TF237055: You cannot destroy a work item type that is being used.
Posted on Mar 21, 2012
in Reference, TFS by David
Removing Existing Work Item Types
To remove an existing Work Item Type (WIT) you must modify the Category template to exclude the WIT in order to avoid receiving an error when attempting to delete.
Error
Unable to destroy work item type Test Case
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.
Remove the WIT from the Categories XML file.
- Open the Visual Studio Command Prompt (2010) by browsing to the location below or set the environment via the command prompt by executing the Batch file (VS2010) :
- “C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat” or Locating the VS Prompt on your Programs Menu
- Export the categories using the [witadmin] command:
- witadmin exportcategories /collection:http://AdventureWorksServer:8080/tfs/defaultcollection /p:AdventureWorks /f:c:\mycategories.xml
- Open the exported categories XML from the location listed for /f: from above using notepad, remove the unwanted work item type by deleting the CATEGORY tag and it’s contents. Then save your changes.
- <CATEGORY refname=”Microsoft.TestCaseCategory” name=”Test Case Category”><DEFAULTWORKITEMTYPE name=”Test Case” /></CATEGORY>
4. Import the modified category file using the import witadmin importimportcategories command.
- witadmin importcategories /collection:http://AdventureWorksServer:8080/tfs/defaultcollection /p:AdventureWorks /f:c:\mycategories.xml
Deleting the unwanted work item type.
- Executed the witadmin destroywitd command to PERMANENTLY delete the work item type and ALL work items of that type. This command is NOT reversible once executed.
- witadmin destroywitd /collection:http://AdventureWorksServer:8080/tfs/defaultcollection /p:AdventureWorks /n:Test Case
- Verify in Team Explorer that the work item type is no longer available.
For more information on managing Work Item types visit the MSDN Site. http://msdn.microsoft.com/en-us/library/dd312129.aspx
Tags: export categories, Team Foundation Server Error, TF237055, TFS, WIT
Defined by your actions while facing adversity and the decisions you make when you think no one is watching. - #Character
Leave a Reply
Thanks for the post. This worked perfectly and solved my issue. Appreciate you sharing it!
Thanks James! I appreciate the comment!