Delete a Work Item

Note: The information in this article applies to Team Foundation Server 2010.

Generally, you will not want to remove any Work Items that are created in Team Foundation Server 2010 but if it's an item that's no longer required, you'll need to use a command line utility to permanently delete a Work Item.

Make sure that you have either installed Visual Studio 2010 or the Visual Studio 2010 Shell.

To use the Visual Studio 2010 Shell, you will need to download and install the Microsoft Visual Studio Team Explorer 2010 - ISO on your workstation.

You will also need to verify that your user account is a member of the "Project Administrators" group through the Project Groups utility in your TFS Control Panel.

Before proceeding, please note that any information associated with a removed Work Item will be lost and we may not be able to recover a snapshot of your Collection from our backup system.

To remove an unwanted Work Item, carry out the following steps:

1. Obtain the ID for the Work Item that you're looking to remove. You can locate the ID directly through Visual Studio or by using the Team Web Access page.

2. Open a Command Prompt window and then access the "IDE" directory for your installation of Visual Studio 2010/Visual Studio 2010 shell which should typically be "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE" or "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE"

3. Run the following command (it may wrap on screen here, but the command should all be on one line):
witadmin.exe destroywi /collection:https://tfsXX.discountasp.net/tfs/CollectionName /id:WorkItemID

Please note that tfsXX should be replaced by your Team Foundation 2010 server, CollectionName will be the name of your collection and WorkItemID is the ID number for the Work Item. For example, if your Team Foundation Server is tfs21, your collection name is "mycollection" and your Work Item ID is 100, the command that you would run is:

witadmin.exe destroywi /Collection:https://tfs21.discountasp.net/tfs/mycollection /id:100
4. When you're prompted for the credentials, supply an administrator user name and the corresponding password.