简体   繁体   English

如果有任何父项正在进行中,则 Azure DevOps 查询工作项

[英]Azure DevOps query for work items if any parent is in progress

I'm working on identifying all of our product backlog items that do not have a story point estimation.我正在努力确定我们所有没有故事点估计的产品待办事项。 However, we have so many PBI(product backlog items) right now that need estimating.但是,我们现在有很多 PBI(产品待办事项)需要估算。 It is simply a mess.这简直是​​一团糟。 I need a query to help scop down the work.我需要一个查询来帮助缩小工作范围。 I know how to create an Azure DevOps query such that I return all the product backlog items which are new which do not have a value for effort .我知道如何创建一个Azure的DevOps的查询,这样我返回所有的产品积压物品。其中包括新的不具有的精力值。

That wiql looks like this那个wiql看起来像这样

SELECT
    [System.Id],
    [System.WorkItemType],
    [System.Title],
    [System.AssignedTo],
    [System.State],
    [System.Tags],
    [Microsoft.VSTS.Scheduling.Effort]
FROM workitems
WHERE
    [System.TeamProject] = @project
    AND [System.WorkItemType] = 'Product Backlog Item'
    AND [System.State] = 'New'
    AND [Microsoft.VSTS.Scheduling.Effort] = ''

However, I need it to add one more step that filters out items that do not have a parent or grandparent in an active status.但是,我需要它再添加一个步骤来过滤掉没有处于活动状态的父项或祖父项的项目。

Question :题 :

What is a query that I could use that work gives me only the “PBI”s I don't have an effort in the state new where one or more of their parents(recursive) has a state of in progress ?什么是我可以使用这项工作的查询只给我“PBI”,我在的状态下没有努力,其中一个或多个父母(递归)的状态为in progress

First of all, there's no such a relationship called “Grandparents” for work items.首先,对于工作项,没有称为“祖父母”的这种关系。

For a specific work item like PBI p, it can only have a “Parent” like a Feature F1, as for the Feature F1 if it has a parent like another Feature F2 which you can call it the “Grandparent” of PBI p logically, but this Feature F2 has nothing to do with the PBI p actually.对于像 PBI p 这样的特定工作项,它只能有一个像功能 F1 这样的“父级”,对于功能 F1,如果它有一个像另一个功能 F2 这样的父级,你可以在逻辑上称之为 PBI p 的“祖父级”,但是这个Feature F2实际上与PBI p无关。 Please check Work link types for a better understanding.请检查工作链接类型以获得更好的理解。

In addition, if you want to query relationships such as “Parent” in Azure DevOps, you can change the “Type of query” to “Work items and direct links”.另外,如果要在 Azure DevOps 中查询“Parent”等关系,可以将“查询类型”更改为“工作项和直接链接”。 You can check Use direct links to view dependencies for more information.您可以检查使用直接链接查看依赖项以获取更多信息。

Please refer to below wiql and you will see how to query PBIs whose effort is null and parent has a state of “I n Progress ”:请参考下面的wiql,您将看到如何查询努力为空父级状态为“I n Progress ”的PBIs

SELECT
[System.Id],
[System.WorkItemType],
[System.Title],
[System.AssignedTo],
[System.State],
[System.Tags]
FROM workitemLinks
WHERE
    (
        [Source].[System.TeamProject] = @project
        AND [Source].[System.WorkItemType] = 'Product Backlog Item'
        AND [Source].[System.State] = 'New'
        AND [Source].[Microsoft.VSTS.Scheduling.Effort] = ''
    )
    AND (
        [System.Links.LinkType] = 'System.LinkTypes.Hierarchy-Reverse'
    )
    AND (
        [Target].[System.TeamProject] = @project
        AND [Target].[System.WorkItemType] <> ''
        AND [Target].[System.State] = 'In Progress'
    )
ORDER BY [System.Id]
MODE (MustContain)

Below is the corresponding Query Editor:下面是相应的查询编辑器:

在此处输入图片说明

You can use the tree work item query type (in my case for user stories):您可以使用树工作项查询类型(在我的案例中用于用户故事):

SELECT 
    [System.Id], [System.WorkItemType], [System.Title], [System.AssignedTo], [System.State], [System.Tags] 
FROM 
    WorkItemLinks 
WHERE 
    ([Source].[System.TeamProject] = '<Your_project>'  AND ( [Source].[System.WorkItemType] = 'Feature'  OR  [Source].[System.WorkItemType] = 'Epic' ) AND  [Source].[System.State] <> 'New')
     And ([System.Links.LinkType] = 'System.LinkTypes.Hierarchy-Forward') 
     And ([Target].[System.WorkItemType] = 'User story'  AND  [Target].[System.State] <> 'New'  AND  [Target].[Microsoft.VSTS.Scheduling.Effort] = '') 
 ORDER BY [System.Id] 
 mode(Recursive,ReturnMatchingChildren)

Query editor:查询编辑器:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure DevOps 查询今天和失败或解决的工作项 - Azure DevOps query for today and failed or resolved work items 当所有链接的子工作项都满足特定条件时,更改 Azure DevOps 父工作项状态? - Change Azure DevOps Parent Work Item status when all linked children work items meet certain condition? 缺少有关 Azure DevOps 工作项的“请求反馈”? - Missing 'Request Feedback' on Azure DevOps work items? 导出和编辑 Azure Devops 中的工作项 - Export and edit work items in Azure Devops 找不到未分配的Azure DevOps工作项用户 - Azure DevOps Work items unassigned user not found 当工作项遇到迭代时的 Azure DevOps - Azure DevOps When Work Items Meet Iterations 在 Azure Devops 中,我可以查询子工作项的子项并将它们发布到板上吗? - In Azure Devops can I query the child of child work items and publish them on a board? 在Azure Devops中形成查询以将所有从一个状态移动到另一状态的工作项拉出 - Form a query in Azure Devops to pull all the work items that moved from one state to another Azure DevOps:如何使用 REST API 从 Azure DevOps 项目中导出工作项? - Azure DevOps : How to export the Work Items from an Azure DevOps Project using REST APIs? Azure DevOps 在一段时间内更改了工作项列表 - Azure devops changed list of work items during a time period
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM