logo
search
Others

How to Query Parent Items with Children in an Iteration in Azure DevOps

Steve KSteve K Oct 9, 2026 869 views

Question details

The user needs to create an Azure DevOps query that returns parent work items containing child items within a specific iteration.

How to Query Parent Items with Children in an Iteration in Azure DevOps
Product
Azure DevOps
Device & OS
not provided
Scenario
Filtering sprint backlogs or generating reports on features and their associated tasks for an active sprint in Azure DevOps.
Observed behavior
Standard flat queries only return individual items without displaying the parent-child hierarchy properly filtered by specific iterations.
Before you start

Ensure you have the necessary permissions to view, create, and save shared or personal queries within your Azure DevOps project.

Solution 1Recommended

Set Up a 'Work Items and Direct Links' Query

Use the built-in query editor in Azure DevOps to filter top-level parent items and specifically return their linked child items.

Azure DevOps provides a specific query type to handle relationships. By configuring a direct-links query, you can fetch features or user stories and only display them if they contain tasks mapped to your target iteration.

1
Navigate to Queries

Open your Azure DevOps project, navigate to 'Boards' from the left sidebar, and click on 'Queries'.

2
Create a New Query

Click the 'New query' button. In the query editor, change the 'Type of query' dropdown from 'Flat list of work items' to 'Work items and direct links'.

3
Configure Parent Filters

In the 'Filters for top level work items' section, set your criteria for the parent (e.g., Work Item Type = Feature or User Story).

4
Configure Child Filters

In the 'Filters for linked work items' section, set criteria for the child items (e.g., Iteration Path = @CurrentIteration).

5
Run and Save

Under 'Filter options', select 'Only return items that have matching links' to ensure you only see parents that actually contain the specified children. Click 'Run query' to test it, then click 'Save'.

Set Up a 'Work Items and Direct Links' Query
Pro Tip: Using the @CurrentIteration macro ensures your query updates dynamically as you move into new sprints, eliminating the need to manually update the iteration path.
Free Microsoft Office alternative

Document Your Sprint Planning and DevOps Queries with WPS Office

While Azure DevOps handles your agile boards and code, writing technical specifications, documenting sprint goals, and analyzing exported query data requires reliable office software. WPS Office is a highly compatible, free, and lightweight alternative to Microsoft Office that helps development teams stay productive.

  1. 1. Download WPS Office: Visit the official WPS Office website to download the free installation package.
  2. 2. Install the Suite: Run the installer and follow the simple on-screen instructions to complete the setup on your PC or Mac.
  3. 3. Open Exported Queries: Export your Azure DevOps query as a CSV file, then right-click and open it directly with WPS Spreadsheet for data analysis.
Seamlessly open and analyze CSV files exported directly from Azure DevOps query results in WPS Spreadsheet.Excellent compatibility with Microsoft Office formats, including .docx, .xlsx, and .pptx.Lightweight installation that will not consume heavy system resources alongside your development IDE.Built-in PDF editing capabilities for generating professional sprint reports and technical documentation.
microsoft office alternative - wps office

Frequently Asked Questions

Can I query across multiple iterations in Azure DevOps?

Yes. In the query editor, you can change the operator for the 'Iteration Path' field to 'In' and select multiple iterations, or utilize the '@CurrentIteration' macro to dynamically filter based on the team's active sprint.

Why are my child tasks not showing up in my query results?

If your query is set to 'Flat list of work items', hierarchical relationships will not be displayed. You must change the query type to 'Work items and direct links' or 'Tree of work items' to view child tasks connected to their parents.

How do I export my Azure DevOps query results to a spreadsheet?

Once you run your query in Azure DevOps, click the 'Export to CSV' button located in the toolbar above the results list. You can then open the downloaded CSV file in spreadsheet applications like Microsoft Excel or WPS Spreadsheet for further sorting and analysis.