How to Query Parent Items with Children in an Iteration in Azure DevOps
Question details
The user needs to create an Azure DevOps query that returns parent work items containing child items within a specific iteration.

- 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.
Ensure you have the necessary permissions to view, create, and save shared or personal queries within your Azure DevOps project.
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.
Open your Azure DevOps project, navigate to 'Boards' from the left sidebar, and click on 'Queries'.
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'.
In the 'Filters for top level work items' section, set your criteria for the parent (e.g., Work Item Type = Feature or User Story).
In the 'Filters for linked work items' section, set criteria for the child items (e.g., Iteration Path = @CurrentIteration).
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'.

Seek Advanced Query Support from Developer Community
Consult Microsoft's official Visual Studio Developer Community for complex DevOps querying scenarios that fall outside standard filters.
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. Download WPS Office: Visit the official WPS Office website to download the free installation package.
- 2. Install the Suite: Run the installer and follow the simple on-screen instructions to complete the setup on your PC or Mac.
- 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.

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.




