How to access workitem link and attachment history
I am working with T开发者_Go百科FS API and trying to create the history tab exactly same as what we see in TFS explorer.
So far I am able to figure our the changes to Fields via WorkItem > Revisions > Fields
I am not able to create the proper history for Links and Attachment changes. Links have Link Type, Work Item, Comment and Change
I can see the Link type and Comment fields in WorkItem > Links but how to figure out change and WorkItem columns?
Similarly for attachments.
Any idea?
Given you have gained access to a WorkItem
"myWorkItem" you can retrieve what you 're after with:
WorkItemLinkCollection LinkedWIs = myWorkItem.WorkItemLinkHistory;
foreach (WorkItemLink workItemLink in LinkedWIs)
{
string AddedDate = workItemLink.AddedDate.ToString();
}
AttachmentCollection AttachedTokens = myWorkItem.Attachments;
foreach (Attachment attachedToken in AttachedTokens)
{
string FileName = attachedToken.Name;
}
精彩评论