Manage and organize queries in Azure Boards and Azure DevOps
Bài viết
Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019
Visual Studio 2019 | Visual Studio 2022
Organize your personal or shared queries by adding a query folder. You can then add queries to or move existing queries into those folders. You can create queries and query folders from the web portal or from a supported client, such as Visual Studio Team Explorer.
Lưu ý
To create and manage queries in Visual Studio 2019, you need to Set the Work Items experience to the legacy option. Also, you can perform bulk drag-and-drop of queries into query folders from Visual Studio but not from the web portal.
Lưu ý
The following images display the user interface with the New Boards Hub feature enabled by default. For more information, see Manage or enable features.
Prerequisites
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.
Lưu ý
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.
Mẹo
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.
Mẹo
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.
Quan trọng
We strongly recommend that everyone use the default view instead of this legacy view. It is designed for you to quickly access a list of work items based on your assignment, following, mentioned, or recent updates. The legacy view is no longer being enhanced and we expect to remove it in a future release of Visual Studio.
From the Team Explorer home page, choose Work Items.
To open a query, open the context menu for the query (right-click with your mouse), and choose View Results. Or, double-click the query to open it.
Or, select one of the following options:
Edit Query: Opens the Query Editor for the selected query.
New Query: Opens the Query Editor with the default new query options.
You can copy a query within the same project by selecting a query and saving it with a new name with the Save as option.
The easiest way to define a query is to start with an existing shared query. The following example shows how to find all closed bugs by modifying the Active Bugs shared query provided with the Agile process template. Examples are based on the user interface provided through the web portal.
Open a shared query. For example, from the web portal, open the Active Bugs or similar flat list query.
Mẹo
If you're working in Visual Studio Team Explorer, open the Work page to access your queries and shared queries. If Team Explorer isn't visible, choose View>Team Explorer from the top level menu.
Edit the query to find closed bugs and then run the query.
Use to insert a clause above the current clause. Use to delete a clause. Queries are automatically scoped to the current project. To find work items defined in several projects, see Query across projects.
Save the query to your My Queries folder.
To save a query to the Shared Queries folder, you need to be a member of the Project Administrators group, or have your Contribute permissions on the folder set to Allow. For more information, see Set query permissions.
Open a shared query. For example, from the web portal, open the Active Bugs or similar flat list query.
Mẹo
If you're working in Visual Studio Team Explorer, open the Work page to access your queries and shared queries. If Team Explorer isn't visible, choose View > Team Explorer from the top level menu.
Edit the query to find closed bugs and then run the query.
Use to insert a clause above the current clause. Use to delete a clause. Queries are automatically scoped to the current project. To find work items defined in several projects, see Query across projects.
Select Save as in the more actions menu.
Lưu ý
If the New Boards Hubs feature is disabled, the Save As selection is at the top of the page.
Save the query to your My Queries folder.
To save a query to the Shared Queries folder, you need to be a member of the Project Administrators group, or have your Contribute permissions on the folder set to Allow. For more information, see Set query permissions.
Quan trọng
We strongly recommend that everyone use the default view instead of this legacy view. It is designed for you to quickly access a list of work items based on your assignment, following, mentioned, or recent updates. The legacy view is no longer being enhanced and we expect to remove it in a future release of Visual Studio.
To save a query as a new query, open the query results and then from the toolbar choose File>Save QueryName As....
Specify the query name and folder location for the query.
To save the query as a .wiq file, choose the File radio button and specify the file location.
From either the Favorites or All page, choose the
actions icon of a query to run, edit, rename, or delete the query.
For shared queries, you can also choose to do one of these tasks:
Add to team queries: Select the team to add the query as a team favorite
Security...: to set permissions for the query. For more information, see Set query permissions.
Add to dashboard: Adds a Query tile widget to the team dashboard you select. For more information, see Add widgets to a dashboard.
Quan trọng
We strongly recommend that everyone use the default view instead of this legacy view. It is designed for you to quickly access a list of work items based on your assignment, following, mentioned, or recent updates. The legacy view is no longer being enhanced and we expect to remove it in a future release of Visual Studio.
From the Work Items page, open the context menu for the query you want to run, edit, rename, or delete and choose the corresponding option.
Add a query folder and move items into a folder
Mẹo
You need Delete permissions to rename or move a shared query or folder, and Contribute permissions for the folder where you move the query to. To view or set permissions, see Set permissions on queries and query folders.
You add query folders from the Boards > Queries > All page.
Choose All. Expand My Queries or Shared Queries depending on where you want to add a query folder.
To add a folder, choose actions icon for an existing folder or the top container folder, and choose New folder.
Enter the name for the folder in the New folder dialog. If you want to change the location of the folder, select it from the Folder drop down menu.
To move items into a folder, drag-and-drop a query onto the folder. From the web portal, you can only drag a single query from outside a folder into a folder.
Optionally, you can choose More commands
for an existing query, choose Edit, and then choose Save As. In the Save query as dialog, choose the folder you want to save the query in.
You add query folders from the Boards > Queries > All page.
Choose All. Expand My Queries or Shared Queries depending on where you want to add a query folder.
To add a folder, choose New folder.
Enter the name for the folder in the New folder dialog. If you want to change the location of the folder, select it from the Folder drop down menu.
To move items into a folder, drag-and-drop a query onto the folder. From the web portal, you can only drag a single query from outside a folder into a folder.
Optionally, you can choose More commands
for an existing query, choose Edit, and then choose Save As. In the Save query as dialog, choose the folder you want to save the query in.
Quan trọng
We strongly recommend that everyone use the default view instead of this legacy view. It is designed for you to quickly access a list of work items based on your assignment, following, mentioned, or recent updates. The legacy view is no longer being enhanced and we expect to remove it in a future release of Visual Studio.
All changes you make to your query folder structure in Visual Studio appear in the web portal by refreshing your browser.
From the Work Items page, open the context menu for My Queries, Team Queries, or an existing query folder, and choose New Folder.
A New Folder is added under the area you selected. To rename a folder, select the folder.
To move queries into a folder, drag-and-drop a query onto the folder. You can select multiple queries and drag them into a folder or from one folder into another folder.
Save a query as a team favorite
To save a shared query as a team favorite, be a member of the team.
To save a query as a team favorite, open More actions
or the
context menu for the query from the Queries page.
Choose Add to team favorites, and then select from the teams listed. Only teams for which you're a member are listed.
To save a query as a team favorite, open the More actions
context menu for the query from the Shared Queries on the Queries page.
Choose Add to team favorites, and then select from the teams listed. Only teams for which you're a member are listed.
Add a query tile to a dashboard
A query tile displays a count of the work items in a query. You can also quickly open the query from the dashboard. You can add a query tile to a dashboard from the Queries page using the following steps, or by following the steps outlined in Add widgets to a dashboard.
To add a query to a dashboard from the Queries page, open the More actions menu
actions icon (or
context icon) for the query.
From the Select a dashboard dialog, choose the dashboard you want to add the query to.
Open the dashboard, and verify the query tile was added. You can configure the query tile to change the default color and to specify the color for the tile based on a conditional rule you specify.
To add a query to a dashboard from the Queries page, open the More actions menu
for the query.
From the Select a dashboard dialog, choose the dashboard you want to add the query to.
Open the dashboard, and verify the query tile was added. You can configure the query tile to change the default color and to specify the color for the tile based on a conditional rule you specify.
Tham gia chuỗi buổi gặp gỡ để xây dựng các giải pháp AI có thể mở rộng dựa trên các trường hợp sử dụng trong thế giới thực với các nhà phát triển và chuyên gia đồng nghiệp.
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.