TFS 2013 API - Retrieve all changes made for WI

自作多情 提交于 2019-12-22 18:29:07

问题


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.


回答1:


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!