Shared Queries (Scrum)

You can manage your workload more effectively by frequently identifying the product backlog items, tasks, impediments, and other work items on which you want to take action. To more easily find all such work items in a particular team project, you can run the queries that the Visual Studio Scrum 2.0 process template provides.

You can open these queries from Team Explorer by expanding your team project, expanding Work Items, and then expanding Shared Queries, as the following illustration shows:

Sreenshot showing scrum team queries

Note

To run work item queries, you must have the appropriate permissions. For more information, see Organize and Set Permissions on Work Item Queries and Team Foundation Server Permissions.

Quick tips

  • All valid users with standard access can create queries and folders under the My Queries area. To create queries and query folders under Shared Queries , you must have the Contribute permission set. For more information, see Set permissions on queries.

  • To find work items that are assigned to you, add @Me as the value for the Assigned To field in one of the query clauses.

  • You can modify any query by adding criteria to focus on a product area, an iteration, or another field that is defined for the types of work items that you want to find. To modify a query, right-click it, and then click Edit. For more information, see Specify Query Filter Criteria.

  • You can open any query in Excel or Project, where you can modify work items and publish your changes back to TFS . Create and modify work items using Excel.

  • To view status or trend charts based on query data, you can Creating Reports in Microsoft Excel by Using Work Item Queries.

For more information about how to work with queries, see Query for Bugs, Tasks, or Other Work Items.

Shared Queries

Your product owner can plan and track product backlog items and bugs in the product backlog by using the Product Backlog query. Your team can arrange and track sprints by using the team query of All Sprints. You can find work items that are assigned to the current sprint by using the team queries that are listed under the Current Sprint folder.

Note

The project administrator for each team project defines area and iteration paths for that project so that the team can track progress by those designations. For more information, see Create and Modify Areas and Iterations.

Shared Queries

Description

Product Backlog

Lists all product backlog items and bugs that are assigned to the root iteration. Product backlog items and bugs are sorted by backlog priority.

Blocked Tasks

Lists all tasks in the current sprint that have been marked as Blocked.

Open Impediments

Lists all open impediment work items in the current sprint.

Sprint Backlog

Lists all product backlog items, bugs, and their linked tasks that your team has committed to complete in the current sprint.

Test Cases

Lists all test cases in the current sprint and sorts them by priority.

Unfinished Work

Lists all product backlog items, bugs, and their linked tasks that have not been marked as Done in the current sprint.

Work in Progress

Lists all tasks in the current sprint that are marked as In Progress.

Q & A

Q: What query operators and variables can I use?

A: The operators and variables available for selection depend on the field that you select. The four variables are @Project for the project name field, @Me for person-name fields, @Today for date-time fields, and [Any]. See Query Fields, Operators, Values, and Variables.

Q: How do I automatically update queries based on the current sprint or iteration?

A: There’s no automatic way to do this; you must manually update queries to point to the current sprint. If your team project is based on Scrum or Agile, you’ll find a set of queries under the Current Sprint or Current Iteration folders. For each query to return items defined for the current sprint, you must update the iteration path to the iteration that is current according to the date.

You can change many of your queries by saving them as .wiq files. Open the query in Team Explorer, choose Edit Query, and then choose File, Save As to save each query as a .wiq file. Here is an example of the Work in Progress query that has been updated to support Release 2\Sprint 59.

<?xml version="1.0" encoding="utf-8"?>
<WorkItemQuery Version="1">
  <Wiql>
    SELECT [System.Id],
           [System.WorkItemType],
           [System.Title],
           [System.AssignedTo],
           [System.State],
           [Microsoft.VSTS.Scheduling.RemainingWork],
    FROM WorkItems 
      WHERE [System.TeamProject] = @project and 
            [System.IterationPath] under 'FabrikamPrime\Release 2\Sprint 59' and 
            [System.WorkItemType] in group 'Microsoft.TaskCategory' and 
            [System.State] = 'In Progress' 
      ORDER BY [System.AssignedTo],
               [Microsoft.VSTS.Common.BacklogPriority],
               [System.Id] 
   </Wiql>
</WorkItemQuery>

Q: How should multiple teams work with queries?

A: Each team should consider creating a team folder under the Shared Queries area and providing contributor permissions to the team members. To learn more, see Organize and Set Permissions on Work Item Queries.

See Also

Concepts

Query for Bugs, Tasks, or Other Work Items

Other Resources

Scrum Process Template for Visual Studio ALM