Populating the TFS WorkItem revisions collection

tfs

I am writing a tool that needs to access all the revisions of a TFS workitem template.

The Workitem has a Revisons collection, and Rev property that returns the number of revisions.

When I try and do a foreach through the collection, even though it contains 6 "entries" in my test workitem, the collection is empty.

To work around this I am using the GetWorkItem(WorkItemID, RevisionID), incrementing the revision ID in a for loop to get the revisions. It seems crazy taht I have to do this and there collection that doesn't contain what it is supposed to.

Am I missing something here, or is this simply a bug in the TFS client API.

Best Answer

After much digging, it is quite clear to me now that if you want to get all the revisions of a work item, you must explicitly load the revision(2) that you want, and this makes the revisions collection pretty much useless.

Related Topic