Does anybody knows how to get all changes related to work item, like how many hours were logged per day? This info is obtainable in web version of TFS in 'All Changes' tab but I couldn't find it by looking through all methods and properties of WorkItem object in debug.
I've also tried to retrieve work items by WorkItem property on RevisionCollection's indexer which returns Revision object, but all these work items seems to be referencing to the final state of WI where all hours have been logged and the task is closed.
If you mean you want to show all the history (what fields changed, when and by who) for certain work items types (user stories, Tasks, Bugs)
There is no API can just show 'all changes' tab info directly. And if you retrieve work items as below
foreach (Revision revision in wi.Revisions)
{
Debug.Write(revision.WorkItem);
}
The revision history can only be retrieved for work item fields available in the collection WorkItem.Fields,you will NOT see the history but end up reloading the current workitem object again and again.
More details, you can refer below link which has a pretty good example of how to do it in C#: Work Item History Visualizer using TFS API
来源:https://stackoverflow.com/questions/35797660/tfs-2013-api-retrieve-all-changes-made-for-wi