Share via


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

I saw some Qs on forums asking about how to delete a test case from MTLM (Microsoft Test and Lab Manager). Please note that you can’t delete a test case from MTLM. 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.

Comments