1

I'm trying to delete some dummy test cases and user stories and I found the official doc to do that. Seems I need to use a cli tool called witadmin.

They mention an incorrect path to that tool. I have Visual Studio 2017 installed and found it at:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer

Then I tried to run this command, which tells which work items to delete from which collection.

.\witadmin.exe destroywi /collection:https://<ORGANIZATION>.visualstudio.com/<PROJECT> /id:405,440,403

A dialog box appeared for me to login, I filled with my user and pass and got this error after a while:

TF31002: Unable to connect to this Team Foundation Server: https://ORG.visualstudio.com/PROJ.
Team Foundation Server Url: https://ORG.visualstudio.com/PROJ.

Possible reasons for failure include:
- The name, port number, or protocol for the Team Foundation Server is incorrect.
- The Team Foundation Server is offline.
- The password has expired or is incorrect.

Technical information (for administrator):
The remote server returned an error: (404) Not Found.

The pass is correct, the server is online. So it can be only the TFS name. What should also be correct, right? I used the same URL of the project. I also tried adding /defaultcollection but then I was unable to pass the login dialog.

I saw this other question suggesting that "you need to have TFS Admin permissions" -- which I don't have.

Any ideas? Should I give up and change the state of the items to "Removed"?

dialex
  • 2,706
  • 8
  • 44
  • 74

2 Answers2

2

There's no need to use WITADMIN for this. If you have the "Delete work items" permission, you can drag and drop work items into a Recycle Bin and delete them from there.

With WITADMIN, you shouldn't include the project in the path.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
2

Refer to these steps to permanently delete work items:

  1. Go to Work page
  2. Right click a work item > Delete
  3. Click Recycle Bin button

enter image description here

  1. Right click a work item > permanently delete

Delete work item via witadmin tool:

witadmin destroywi /collection: https://ORG.visualstudio.com /id:405,440,403

More information, you can refer to: Delete work items

starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53