Reputation: 3221
Someone on my team accidentally deleted a VSTS work item. I'm looking at Get Started with REST APIs it looks like I can do this with a small C# program. I'm wondering what I should put in for the personal access token though. Can I get this by doing a fiddler trace while logging into VSTS? Alternatively, is it possible to do this without writing a custom program? I'm using VS 2017 Enterprise.
Upvotes: 0
Views: 708
Reputation: 33698
You can send the REST API request through CURL or Postman tool.
For CURL:
curl -u test:[personal access token] --data {"IsDeleted":false} -X PATCH https://[account].visualstudio.com/DefaultCollection/_apis/wit/recyclebin/[work item id]?api-version=3.0-preview -H "Content-Type:application/json"
For Postman:
Upvotes: 1
Reputation: 1999
To programmatically play with the Recycle Bin of the Work Items there are these specific REST APIs for Visual Studio Team Services (aka VSTS or VSO).
In particular you can read how to restore a work item
As per Personal Access Token (aka PAT), you should:
Upvotes: 0
Reputation: 3221
The recycle bin icon is (currently) in the lower left hand corner in VSTS, so you can go there to undelete items that you've deleted accidentally. Still be curious for more information on using the REST APIs though.
Upvotes: 0