First get the workitem in code (as per TFS code samples) then:
foreach(Revision rev in wrkitem.Revisions)
{
foreach(Field f in rev.Fields)
{
Console.WriteLine(“{0} = {1}\n”,f.Name,f.Value);
}
}
There is also the OriginalValue property on fields as an alternative (for some styles of history access):
foreach(Field f in rev.Fields)
{
if(!Object.Equals(f.Value, f.OriginalValue))
{
Console.WriteLine(“{0}: {1} -> {2}”, f.Name, f.OriginalValue, f.Value);
}
}
Leave a comment