admin管理员组文章数量:1124679
I'm working with an Azure DevOps WIQL Query. We are trying to do a query on "WorkItems", that returns a lot of records, but will also need to know the parent of every record. My hope was that I would be able to make a query to "WorkItemLinks" instead, but we are receiving different results.
Here is my WIQL syntax that returns the items we are looking for:
SELECT [System.Id] FROM WorkItems WHERE [State] = "To Do" AND [System.TeamProject] = @project
In order to get the ID of every WorkItem, I would then need to make GET requests to get all the WorkItems individually. My hope was that I might be able to make use syntax like
SELECT [System.Id] FROM WorkItemLinks WHERE [Target].[State] = "To Do" AND [Target].[System.TeamProject] = @project
At first glance, this looks to me like it should return the link information for all of the same WorkItems as the first query, but in practice it returns entirely different results. While some of the same WorkItems are included, there are many that are not, and many are included that are not found by the first query.
Can someone explain why these two queries return completely different results?
I'm working with an Azure DevOps WIQL Query. We are trying to do a query on "WorkItems", that returns a lot of records, but will also need to know the parent of every record. My hope was that I would be able to make a query to "WorkItemLinks" instead, but we are receiving different results.
Here is my WIQL syntax that returns the items we are looking for:
SELECT [System.Id] FROM WorkItems WHERE [State] = "To Do" AND [System.TeamProject] = @project
In order to get the ID of every WorkItem, I would then need to make GET requests to get all the WorkItems individually. My hope was that I might be able to make use syntax like
SELECT [System.Id] FROM WorkItemLinks WHERE [Target].[State] = "To Do" AND [Target].[System.TeamProject] = @project
At first glance, this looks to me like it should return the link information for all of the same WorkItems as the first query, but in practice it returns entirely different results. While some of the same WorkItems are included, there are many that are not, and many are included that are not found by the first query.
Can someone explain why these two queries return completely different results?
Share Improve this question asked yesterday David Carli-ArnoldDavid Carli-Arnold 334 bronze badges1 Answer
Reset to default 0It looks like you are trying to query linked work items:
SELECT [System.Id] FROM WorkItemLinks WHERE [Target].[State] = "To Do" AND [Target].[System.TeamProject] = @project
Try to query source items:
SELECT [System.Id] FROM WorkItemLinks WHERE [Source].[State] = "To Do" AND [Source].[System.TeamProject] = @project
Additionally, you may query through the link type:
SELECT [System.Id] FROM WorkItemLinks WHERE [Source].[State] = "To Do" AND [Source].[System.TeamProject] = @project and [System.Links.LinkType] = 'System.LinkTypes.Hierarchy-Reverse' MODE (MayContain)
Useful links:
- Query for links between work items
- Reference guide for link types
本文标签:
版权声明:本文标题:azure devops - WIQL Query: WorkItemLinks Query that returns same results as WorkItems Query - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736603346a1945270.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论