开发者

How to access workitem link and attachment history

开发者 https://www.devze.com 2023-04-07 10:17 出处:网络
I am working with T开发者_Go百科FS API and trying to create the history tab exactly same as what we see in TFS explorer.

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;
 }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号