Get the history "text" of a past work item edit
Asked Answered
P

2

7

Say I make a work item in TFS. Then I make a change and update the text in the History tab (then save).

Using the TFS API, how can I get that text?

I would have thought it would have been in the History string for last item in the Revisions collection on the work item. (Because to set the string via the API you can use History on a normal work item.) However, in the Revisions array, all the work items are showing up as having History empty.

Any ideas on how I can get this string?

Palpate answered 20/4, 2011 at 22:20 Comment(0)
L
4

Check this blog post out: http://blogs.msdn.com/b/aaronbjork/archive/2011/01/10/programmatically-reading-work-item-comments.aspx

It’s a simple operation, but it might not be clear at first unless you discover that you need to loop through the collection of Revisions of the work item in order to view those comments.

Louislouisa answered 21/4, 2011 at 15:20 Comment(0)
D
1

You can get any of the basic tfs fields via aaronbjork's link and change it to use

Field f = r.Fields.TryGetById(1); or Field f = r.Fields["Title"]

  • title = 1
  • description = 52
  • the list of names and Ids is in the CoreField enumeration (only for non-custom fields)
Dragonhead answered 23/9, 2014 at 18:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.