How can I get a list of my BackLog elements in TFS in a hierarchical format?

I am trying to list all of my log items, but some lag items have children. I would like to list them as follows: BackLogItemParent / BackLogItemChild1 / BackLogItemChild2, etc. For many children of each parent element.

I can get all log items:

public WorkItemCollection BackLogItems()
        {
            WorkItemCollection results = this.tfsWorkItemStore.Query(
                "Select [System.Id], [System.Title] " +
                "From WorkItems " +
                "Where [Work Item Type] = 'Product BackLog Item' " +
                "And [System.Title] <> '<unused>' " +
                "Order By [System.Title] Asc"
                );

            return results;
        }

and maybe something like:

 private WorkItem GetChildBackLogItems(WorkItem wi)
        {                
            foreach (WorkItemLink wil in wi.WorkItemLinks) 
            {                    
             //some sort of recursive call to get all links if backlog is a parent
             //but may need to filter out by top parent items first.
            }
            return wi;
        }

But it’s difficult for me to create the list as I would like, since I did not quite understand how the link is indicated in the code. I suspect that I may need to use the workitemlinks table instead.

" ", , , - .

.

+4
2

Visual Studio, , , " ...", . "".

, WorkItemStore.Query().

.

0

All Articles