Search code examples
c#tfsazure-devopstfs-sdk

What is the difference between Links and WorkItemLinks properties of WorkItem class of TFS?


I'm working on an application which extracts data from Visual Studio Team Services and stores it in local db for statistics purposes. The links between workitems are important part of our reports. The information needed for me is the same you can find under the links tab in Visual Studio Team Services. There are the Links and WorkItemLinks properties of WorkItem class and there is no clear description which one stores what kind of data. So, I don't know which one is needed for me. The Links name on the Visual Studio Team Services user interface suggest that the I should deal with the Links property, but now I'm curious why there are two similar property.


Solution

  • If I remember correctly the distinction is as follows:

    • Links: contains all links, including Version control, Hyperlinks and other type of links.
    • WorkitemLinks: contains all work item links that link to this work item. So only links between this work item and other work items.

    Making WorkItemLinks a subset of Links.

    You'll see that the Links property has a bunch of Add(RelatedLink|Link|HyperLink|ExternalLink) methods where WorkItemLinks only has Add(WorkItemLink).