Shared Queries Azure DevOps

In this tutorial, I will walk you through everything you need to know to create, manage, and optimize shared queries in Azure DevOps. This isn’t just about technical clicks; it’s about building a “single source of query” for your entire organization.

Shared Queries Azure DevOps

Why Shared Queries

Shared queries allow you to:

  • Align Stakeholders: Ensure that everyone—from your Scrum Master to your VP of Engineering—is tracking the same KPIs.
  • Standardize Reporting: Create a uniform way to view “Technical Debt” or “Sprint Progress.”
  • Power Dashboards: Shared queries are the engine behind Azure DevOps Dashboards and Widgets.
  • Enhance Communication: Instead of explaining what’s on your plate during a stand-up, you can simply point to a shared view.

Understanding the Query Hierarchy

Azure DevOps organizes queries into two primary folders. Understanding the distinction is the first step toward authority in the tool.

FeatureMy QueriesShared Queries
VisibilityOnly you can see them.Anyone with permissions in the project can see them.
Best Use CasePersonal “To-Do” lists and draft queries.Sprint tracking, bug triaging, and stakeholder reporting.
PermissionsManaged by the individual.Managed by Project Administrators or specific group leads.
AutomationHarder to use with external alerts.Ideal for email subscriptions and dashboard widgets.

Step 1: Navigating to the Queries Hub

To begin our tutorial, let’s get into the environment.

  1. Open your Azure DevOps organization (e.g., dev.azure.com/YourEnterprise).
  2. Select your project from the sidebar.
  3. Navigate to Boards and click on Queries as shown in the screenshot below.
Shared Queries Azure DevOps

You will see the two-pane view I mentioned earlier. If you are part of a large team, the Shared Queries folder might already contain subfolders such as “Sprints,” “Bugs,” or “Management Reports.”

Step 2: Creating Your First Shared Query

Let’s say our goal is to track all “High Priority Bugs” across a specific release.

Drafting the Logic

Click on New Query. You’ll be presented with the Query Editor. This is where the magic happens. I tend to follow a standard logic flow:

  • Work Item Type: = Bug
  • State: <> Closed (This ensures we only see active work)
  • Priority: = 1 or 2
  • Area Path: Under your specific product area.
how to create shared queries in azure devops

Saving to Shared Queries

This is the most critical part of the tutorial. When you click Save Query, a dialog box appears. By default, it might point to “My Queries.” You must expand the Shared Queries folder to save it there. Check out the screenshot below for your reference.

create shared query azure devops

Pro Tip: Use a naming convention that makes sense for your US-based team. Avoid names like “Query1.” Instead, use [Team Name] - High Priority Bugs - Active.

Step 3: Organizing with Folders and Subfolders

As your project grows from a small startup in Boulder to a massive enterprise, your list of shared queries will become unmanageable if you don’t organize.

I highly recommend creating a folder structure that mirrors your organizational hierarchy or your SDLC phases.

Recommended Folder Structure

  1. Management Reports: High-level views for Directors and VPs.
  2. Sprint Planning: Queries used during the bi-weekly planning sessions.
  3. Triage: Specifically for incoming bugs and feature requests.