Search code examples
c#tfsworkitem

Find out if a TFS work item is a successor in C#


I have an application that finds changesets on a workitem and its related workitems changesets. My Method takes a list of workitem ids. I first want to check if the workitem id is a successor before iterating through the list. How would I do this?

foreach (string workItemId in _workItemIds)
      WorkItem workItemSuccessor = workItemStore.GetWorkItem(int.Parse(workItemId));
      object workItemType = workItemSuccessor.Fields["?"].Value;

what property finds out if a workitem is a successor?

I cant seem to find any documentation online on how I would determine this.


Solution

  • You need to iterate through the work item links (either WorkItemLinks or Links) and look for predecesor/successor links, then check on which side of the links this work item is.

    The link type reference name for this link type is: System.LinkTypes.Dependency.