获取 TFS 中工作项的评论历史记录 [英] Fetching the comment history for a work item in TFS

查看:35
本文介绍了获取 TFS 中工作项的评论历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在大多数缺陷跟踪器中,都有与故障单/事件/问题/工作项相关联的评论历史记录.

In most defect trackers there is a comment history associated with a ticket/incident/issue/work item.

我希望通过工作项的 SDK 从 TFS 获取相同的信息 - 理想情况下:

I wish to get this same information from TFS via the SDK for a work item - ideally:

  • 谁创建了评论.
  • 评论的文本.
  • 谁最后更新/编辑了评论(如果 TFS 中可能发生这种情况?)

我已确定 WorkItem 具有通过修订"属性可用的修订集合,并且您可以遍历每个修订——但修订没有历史"属性,我认为我可以在其中找到评论由用户创建.此外,我不认为每次更改都必须记录评论 - 所以我怀疑我需要忽略没有任何历史属性信息的修订?

I have determined that a WorkItem has a collection of revisions availabe via the "Revisions" property, and that you can loop through each revision - but a revision does not have a "History" property where I assume I could find the comment created by the user. Also I don't believe it's compulsory to record a comment with each change - so I suspect I will need to ignore revisions that don't have any history property information?

修订MSDN 上的属性

关于在 TFS 中获取工作项的评论历史"信息的最佳方法的任何想法 - 修订列表是正确的方法,还是我应该使用 API 的其他部分?

Any thoughts on the best way to fetch this "comment history" information for a work item in TFS - is the revisions list the correct way, or should I be using some other part of the API?

推荐答案

为了获取评论历史,您需要访问工作项修订的历史"属性.

In order to fetch the comment history you need to access the "History" property on the Work Item revision.

WorkItem.History 属性

显然,工作项的当前(最新)版本会将这个字段设为空,但历史修订评论会在那里.

Obviously the current (latest) version of the work item will have this field as empty, but historical revision comments will be there.

TFS:获取工作项历史记录来自 api

团队资源管理器中工作项上显示的历史"是通过循环遍历修订并显示更改的字段和历史"属性中的文本来构建的

The "History" displayed on a work item in Team Explorer is built by looping through the Revissions and displaying both the fields that were changed and the text in the "History" property

这篇关于获取 TFS 中工作项的评论历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆