I know every TFS work item shows it's history, but it's "find the difference" painful process... How can I query by history to see WHAT was actually changed? Assume I don't know what was changed, or that multiple items were changed, so I can't use an actual word or phrase
You can use either the web portal or Team Explorer to view the history of a work item or find work items based on the contents of the History field. When you run a search on the contents of the History field, it returns only work items that have changes recorded in that field.
By installing the Wiql Editor Marketplace extension, you can construct your queries using the Query Editor and then view the WIQL syntax. You can then copy and modify the WIQL syntax and run the query using the Wiql Playground hub added to Boards.
To display the History window: In Source Control Explorer, select an item, open its shortcut menu, and then choose View History.
To run any query, expand a folder and choose the title of the query. The view opens to display the query Results. You can also run a query by using the Azure DevOps command line interface. The Queries page, as with other web portal pages, remembers the view you last navigated to and returns you to that view.
Are you using Visual Studio Online (VSO)? If so, you can use the REST API and specifically the Updates method to see what changed in each revision of a work item. This will let you easily see the difference between two consecutive revisions.
If you want the changes between, say, revision 3 and revision 8 then you will need to aggregate the individual revision changes yourself to see the net difference between those two revisions.
If you're using an on-premise TFS server then you'll be using the .NET API. For that, have a look at this CodeProject article for more information, but the basics are that you need to do something like this to see all the revision information:
var tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(
new Uri("https://tfs2010:8080/defaultcollection"));
var service = tfs.GetService<WorkItemStore>();
var workItem = service.GetWorkItem(id);
foreach (Revision revision in workItem.Revisions)
{
foreach (Field field in wi.Fields)
{
//Do something interesting here instead
var change = revision.Fields[field.Name].Value
}
}
From there, it's up to you to work out what information you're actually interested in.
have a look at the: work item history visualizer
also, there's get-tfsitemhistory
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With