Retrieving comment history for a work item in TFS

Most tracker detectors have a comment history related to the ticket / incident / problem / work item.

I want to get the same information from TFS via the work item SDK - ideally:

  • Who created the comment.
  • Comment text.
  • Who last updated / edited the comment (if this event is possible in TFS?)

I determined that WorkItem has a collection of revisions availabe through the “Revisions” property and that you can scroll through each revision, but the revision does not have a “History” property, where I assume that I can find the comment created by the user. In addition, I do not consider it necessary to write a comment with each change - so I suspect that I will need to ignore revisions that do not have any information about the properties of the story?

MSDN Version Property

Any thoughts on the best way to get this “comment history” for a work item in TFS - is this the correct version list or should I use some other part of the API?

+6
tfs sdk tfs2010
source share
1 answer

To get the comment history, you need to access the "History" property in the Work Item edition.

WorkItem.History Property

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

TFS: Getting work history from api

The "History" displayed in the work item in Team Explorer is created by cycling through and displaying both the changed fields and the text in the "History" property

+10
source share

All Articles