Events
17 Mar, 9 pm - 21 Mar, 10 am
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019
Visual Studio 2019 | Visual Studio 2022
To locate work items assigned to you or your team, you can run a query. Your process could include several predefined queries that you can access and run. Often, it's easier to create a new query by modifying an existing query definition.
Note
The following images display the user interface with the New Boards Hub feature enabled by default. For more information, see Manage or enable features.
Category | Requirements |
---|---|
Access levels | - To view and run shared queries: Project member. - To add and save a shared query: At least Basic access. |
Permissions | Contribute permission set to Allow for the folder that you want to add a query to. By default, the Contributors group doesn't have this permission. |
Note
Users with Stakeholder access for a public project have full access to query features just like users with Basic access. For more information, see Stakeholder access quick reference.
Category | Requirements |
---|---|
Access levels | - To view and run shared queries: Project member. - To add and save a shared query: At least Basic access. |
Permissions | Contribute permission set to Allow for the folder that you want to add a query to. By default, the Contributors group doesn't have this permission. |
From your web browser, (1) check that you selected the right project, (2) choose Boards > Queries, and then (3) choose All.
The Queries page opens to the Favorites tab that lists the queries you set as favorites. You can choose the All tab to view all queries you defined and shared queries for the project.
Tip
Queries you or your team have chosen as favorites show up on the Favorites page. Favorite queries along with other objects also appear on your Project page. For more information, see Set personal or team favorites.
From your project, choose Boards > Queries, and then choose All.
The Queries page opens to the Favorites tab that lists the queries you set as favorites. You can choose the All tab to view all queries you defined and shared queries for the project.
Tip
Queries you or your team have chosen as favorites show up on the Favorites page. Favorite queries along with other objects also appear on your Project page. For more information, see Set personal or team favorites.
To run any query, expand a folder and choose the title of the query. The view opens to display the query Results.
You can also run a query by using the Azure DevOps command line interface.
Tip
The Queries page, as with other web portal pages, remembers the view you last went to and returns you to that view.
Choose All to open the page where you can view all queries that you defined or are shared within your project.
Choose My Queries as needed.
Choose Shared Queries to expand the folder and access queries saved as shared queries.
Choose a folder within a breadcrumb to open a query folder.
Tip
The Queries page, as with other web portal pages, remembers the view you last went to and returns you to that view.
Choose All to open the page where you can view all queries you defined or that are shared within your project.
Choose My Queries as needed.
Choose Shared Queries to expand the folder and access queries saved as shared queries.
You can run a query in the CLI with the az boards query command. To get started, see Get started with Azure DevOps CLI.
az boards query [--id]
[--org]
[--path]
[--project]
[--wiql]
--id
or --path
is specified.az devops configure -d organization=ORG_URL
. Required if not configured as default or picked up using git config
. Example: --org https://dev.azure.com/MyOrganizationName/
.az devops configure -d project=NAME_OR_ID
. Required if not configured as default or picked up using git config
.The following command runs a query with the specified ID and shows the result in table format.
az boards query --id 6c286d74-26a5-4cce-bfcf-bf9123495bfe --output table
Priority Node Name Work Item Type Title Remaining Work
---------- ---------------- ---------------- -------------------------------- ----------------
1 Voice Bug Apply fix elsewhere as needed
2 CMMI Bug Slow response on form
1 Fiber Bug Check issues with permissions 0
2 Fiber Bug Voicemail hang issue 0
2 FabrikamBB Bug Research slow response time
1 FabrikamBB Bug Fix performance issues 0
The following command runs a query with the specified WIQL and shows the result in table format.
az boards query --wiql "SELECT [Microsoft.VSTS.Common.Priority], [System.NodeName], [System.WorkItemType], [System.Title], [Microsoft.VSTS.Scheduling.RemainingWork], [System.AssignedTo], [System.State], [System.Tags], [System.AreaPath] FROM workitems WHERE [System.WorkItemType] = 'Bug' AND [System.AreaPath] = 'Fabrikam Fiber' ORDER BY [System.WorkItemType]" --output table
Priority Node Name Work Item Type Title Remaining Work
---------- -------------- ---------------- ---------------- ----------------
2 Fabrikam Fiber Bug Slow response on form
2 Fabrikam Fiber Bug Check permissions
2 Fabrikam Fiber Bug Fix performance issue
2 Fabrikam Fiber Bug Secure Sign-in
Note
You can't add folders to My Favorites or Team Favorites.
The Queries page contains a Favorites and an All tab. Each contains a directory-focused view that you can filter to find specific queries of interest.
When you're working in the Queries pages, you can go to a folder, subfolder, or a query page.
As you make selections, the breadcrumbs are shown at the top of the page. You can navigate to a folder, subfolder, or query page.
You can also select a favorite query or return to the All queries page from the drop-down menu of an open query.
For more information, see Query FAQs, Navigate, and Folders.
You can do most tasks for viewing and running queries from each of the queries list pages as indicated in the following table. Only queries you save under My Queries and have favorited show up under My Favorites. Only queries saved under Shared Queries can be favorited by a team.
Task |
Favorites (Browser) |
All (Browser) |
Work Items (Team Explorer) |
---|---|---|---|
View all favorited queries, yours or a team you belong to | ✔️ | ✔️ | |
View all your queries or shared queries for the current project | ✔️ | ✔️ | |
Run a query, open the context menu for a query | ✔️ | ✔️ | ✔️ |
Expand or collapse container folders or query folders | ✔️ | ✔️ | ✔️ |
Filter the list of queries | ✔️ | ✔️ | |
Favorite a query (for web portal, choose ![]() |
✔️ | ||
Unfavorite a query (for web portal, choose ![]() |
✔️ | ✔️ | ✔️ |
Add a new query: Choose ![]() |
✔️ | ✔️ | ✔️ |
Enter a keyword into the filter box to filter the set of queries displayed on either the Favorites or All pages. To learn more about filtering, see Filter backlogs, boards, queries, and plans.
For more information, see Query FAQs, Navigate, and Folders.
From the Query Editor or Results view, you can email a formatted list of query items or copy the query URL.
Choose the
actions icon to open the menu and select from the options listed, Email query or Copy query URL.
Choose the more actions icon
to open the menu and select from the options listed, Email query or Copy query URL.
You can only send the email to individual address for a project member that the system recognizes. Adding a team group or security group to the "To" line isn't supported. If you add an email account that the system doesn't recognize, you receive a message that one or more recipients of your email doesn't have permissions to read the mailed work items.
Note
To email a formatted list to people who aren't project members, you'll need to use the Copy as HTML option described in Copy a list of work items. For on-premises Azure DevOps, all email actions require an SMTP server to be configured. If you don't have an SMTP server configured, you can work around this by using Copy as HTML.
Events
17 Mar, 9 pm - 21 Mar, 10 am
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Module
Work with queries in Dynamics 365 Business Central - Training
Learn how to work with the Query object in Dynamics 365 Business Central to join, filter, and aggregate data.
Documentation
Define a work item query in Azure Boards - Azure Boards
Learn how to use queries and perform tasks like define a flat-list, clause, or hyperlink, and use a tree, direct link, hyperlink, or logical expression. Also learn how to query across or within projects and view results in a dashboard, and best practices.
Query fields, operators, macros, and variables - Azure Boards
Learn about field data types, operators, and macros/variables used by the Query Editor in Azure Boards and Azure DevOps.
Use managed queries to list work items - Azure Boards
Learn how to track work by creating queries to list work items in Azure Boards and Azure DevOps.