VSTS查询:筛选同时关联Development与Deployment任务的PBI
How to Filter PBIs with Both Development and Deployment Tasks in Azure DevOps
Here's a straightforward, step-by-step guide to build the exact query you need:
Start a new query
- Navigate to your Azure DevOps project, go to Boards > Queries
- Click New Query and select the Work Items and Direct Links query type—this lets you filter PBIs based on their linked tasks.
Set up the top-level PBI filter
- In the upper pane (labeled "Work items that match the following"), configure:
Work Item Type= Product Backlog Item (adjust this if your team uses a different name for PBIs, like User Story)- Add any extra filters you need (e.g.,
State!= Closed) to narrow down active/relevant PBIs.
- In the upper pane (labeled "Work items that match the following"), configure:
Add linked task filters to enforce both activity types
- In the lower pane (labeled "And linked work items that match the following"), we’ll set up two groups to ensure the PBI has at least one Development task AND one Deployment task:
- Click Group to create your first filter group. Inside it, set:
Link Type= Child (use whatever link type your team uses between PBIs and tasks—Child is standard for parent-child task relationships)Work Item Type= TaskActivity= Development
- Click Add group to make a second filter group. Inside this one, set:
Link Type= ChildWork Item Type= TaskActivity= Deployment
- Switch the logic between the two groups from
ORtoAND(use the dropdown next to the group headers) - At the top of the lower pane, set the link matching option to "Match all of the linked work item filters"—this ensures both task types must exist for the PBI to show up.
- Click Group to create your first filter group. Inside it, set:
- In the lower pane (labeled "And linked work items that match the following"), we’ll set up two groups to ensure the PBI has at least one Development task AND one Deployment task:
Save and run your query
- Name your query something descriptive (e.g., "PBIs with Both Dev and Deployment Tasks")
- Hit Run—you’ll only see PBIs that have at least one Development task AND one Deployment task linked to them.
Quick Troubleshooting Note
If you’re not getting the right results, double-check:
- The link type between PBIs and tasks matches what your team actually uses
- The
Activityfield values exactly match how they’re set on your tasks (no typos or case mismatches) - The group logic is set to
ANDand the link matching option is set to "Match all"
内容的提问来源于stack exchange,提问作者Confused
相关产品推荐
相关产品推荐

