How to delete a Test Case / any other Work Item?

Note: Cross posted from Rubel's Blog.
Permalink

I saw some Qs on forums asking about how to delete a test case from MTM (Microsoft Test Lab Manager). Please note that you can’t delete a test case from MTM. But as test case is eventually a work item so you can achieve the same using witadmin provided you’ve admin permissions. witadmin is a command-line utility and is located in %Program Files%\Microsoft Visual Studio 10.0\Common7\IDE. Please note that this is an admin operation and we don’t encourage using it a lot in general. The usual guideline is to close the obsolete / not required test cases and move it out of your test suite.

Anyhow, here is the way to delete the test case or any other work item using witadmin:

witadmin destroywi /collection:CollectionURL /id:id [/noprompt]

The following example deletes the work items with IDs, 12, 15, and 23 from the database for Collection1 on the AdventureWorksServer server:

witadmin destroywi /collection:https://AdventureWorksServer:8080/AWTeam/Collection1 /id:12,15,23

You can read in detail about permanently removing work items using witadmin here.

Note: Cross posted from Rubel's Blog.
Permalink

Comments

  • Anonymous
    March 23, 2010
    The comment has been removed
  • Anonymous
    November 09, 2011
    Hi Ribel, How to get collection ??? The answer is you will get the collection name under Team foundation server administration console window->Application Tiet -> Team Project collection->Collection URL. Rajneesh Prakash