我有这个WIQL ...
Wiql wiql = new Wiql() { Query = string.Format("SELECT [System.Id], [System.WorkItemType], [System.Title], [System.AssignedTo], [System.State]" + " FROM WorkItemLinks" + " WHERE Target.[System.TeamProject] = '{0}'" + " AND Source.[System.Id] = {1}" + " AND [System.Links.LinkType] = 'System.LinkTypes.Hierarchy-Forward'" + " mode(Recursive)", project, startingChildId) };
我想使其与该TFS查询相匹配,其中特定工作项的所有父项都放入树中,如下所示。
我的问题是,我只从需要父级工作项的情况下获取子级工作项。我如何遍历树而不是遍历树?我已经尝试切换System.Links.LinkType
到等效的父关系,但是这样做会引发不受支持的错误。
检查以下WIQL:
select [System.Id], [System.WorkItemType], [System.Title], [System.AssignedTo], [System.State] from WorkItemLinks where ([System.Links.LinkType] = 'System.LinkTypes.Hierarchy-Forward') and (Target.[System.Id] = 4839) order by [System.Id] mode (Recursive, ReturnMatchingChildren)