Undo (or discard saved changes) WorkItem for old version in TFS API
I am looking to create an undo mechanism for a TFS work item using the TFS API - this will undo the changes made. Basically, after saving the new data (also using the API) in the work item, I would like the parameter to return the WorkItem back to the previous version.
Pseudo code is something like this ...
1) Get the current work item for Id: xxxxxx
2) Get the "revision id" of this last work item and save it to "PreviousRevId"
3) Change field values
4) Save
5) why we no longer want these changes (domain logic as for reasons excluded for brevity)
6) Revert to the old version ("PreviousRevId") and make it the current (latest) version
source to share
Have a look at the Visualizer Visual Studio I created. By accepting the work item ID, you can display the history of all work item fields.
But it will help you get information, take a break, you will need to create your own control to create the returned functionality.
EDIT: It's also worth checking out this visual studio extension ** http://visualstudiogallery.msdn.microsoft.com/d127b275-b7b6-4504-b01e-58b4a010ff53 This allows you to see the work item as it was in historical date. Giving you the base effect affects you. NTN
source to share