Using Query Tile Pro to boost your Azure DevOps Dashboard
By: Cris Motinha
Tags: Azure Devops, Metrics, Dashboard, Agile, Query Tile Pro

Dashboards ❤

Metrics should be easy to find, easy to understand and easy to keep an eye on. When collecting Agile metrics such as Lead Time or Cycle Time, most of boards/dashboards systems have automatic widgets or reports and Azure DevOps board is one of them. And if you don’t find a “native” solution, you can download one of the many widgets at Extension Gallery. Here I’m going to talk about my favorite widget to get more complex metrics, the ones that involve aggregation and math operations with more than one query result set.

Query result tiles are an easy solution if you have to keep track of the total number of work items, for example, how many bugs or the sum of Story Points you have in an Iteration. But if you want the number of tasks instead, the default Query Tile won’t work. And this is where Query Tile Pro comes in.

As its publisher Mattias Sköld wrote, you can summarize field values, calculate min and max values on all fields, including text & date fields and much more. Here I’ll show you how you can include the widget in your dashboard and understand basic and advanced configuration modes.

Adding the widget

Before adding Query Tile Pro to your dashboard, you need to add it to your organization. On a dashboard, click on Edit, and on Add Widget, click on the link “Extension Gallery”.

Let’s explore the Extension Gallery

Query Tile Pro is the first result:

After clicking on it, it will open the main page of the product. Now click on Get it free, select your organization and click on Install. When it’s installed, it will show you this page, and you’re ready to go!

To add to a dashboard, open the desired dashboard, click on Edit and after clicking on Add Widget, it should appear in the list as the rest of the widgets. Just drag and drop or click on “Add”.

Configuring Basic Mode

What to do when we want to count the children of a User Story? It’s pretty easy using Query Tile Pro. Let’s calculate how many Bugs we have inside new User Stories.

First of all, you need a query that returns all Bugs inside new User Stories.

See that “2 linked” in the count results? That’s what we want.

Although Query Tile Pro doesn’t force you to save queries in Shared Queries as Query Tile does, I recommend it if you are going to use in a dashboard that other people than you have access.

Now, add the widget to a dashboard and open the Basic mode. In Query, select the query you created. As we want the count of the children, select Children for filter and Count for aggregation. Hit enter to update the result in the tile:

Now finish your tile adding a Title and a Subtitle!

Now save and enjoy your new tile :)

Configuring Advanced Mode

In Advanced Mode we can create variables, therefore, make math operations! Let’s calculate the User Story percentage in our backlog.

First, you need a query that returns all User Stories and one that returns everything.

All User Stories in backlog

All in the backlog

Again, I recommend saving the query in Shared Queries if you are going to use the tile in a dashboard that other people than you have access.

Now, add the widget to a dashboard and open the Advanced mode.

To set up your first variable, select the query that returns all User Stories, and give this result a name. This name can’t have spaces. Also, in this case, select All for filter and Count for aggregations, as we want the number of all User Stories.

Now, click on Add query. Yes, I know it doesn’t look like a link or a button. And it doesn’t show the “hand icon” that shows something is clickable, but it is. Please believe me ;) When clicked, it shows another group of configurations fields(name, query, filter, and aggregation).

Now, complete selecting the query that returns everything and giving this variable a different name. Select All for filter and Count for aggregation again.

Now, having all the count results we need, we have to input the Result expression. Let’s start simple: allUserStories/allInBacklog. After adding the expression, press Enter to make it update the result in your tile.

I had 2 User Stories and 2 Bugs in my backlog (4 items in total), so the result is 0,5

But we want to show as a percentage, so we need to multiply it by 100, and now the Result expression is (allUserStories/allInBacklog)*100. Hitting Enter again we will see 50 as a result.

Tip: as result expressions can get more and more complicated, I strongly suggest to use parenthesis when making calculations. It’s easier to see what’s been computed first.

Now that we have the right result, let’s finish the configuration. Set up a Title and a Subtitle:

And let’s set that when this number is below 80%, it should turn red.

Conditional formatting is pretty simple when comparing values. But what if I need something more complex? What if my problem is having less than 80 US, but only when we’re on the second half of the month? In this case, we should use “Expression” instead of “Value”.

We need some JavaScript for this one, and our expression is:

(@value < 80) && (new Date().getDate() > 15)

“(@value < 80)” is what we already had, when the result is less than 80.

“(new Date().getDate() > 15)” is getting the day of today and comparing to 15 (the half of the month). Here we have some examples of date manipulation in JavaScript (ps: I have not tested all these options yet).

And between the two expressions, “&&” is a logical operator, and it means that both expressions must be true to color the tile. Your widget config should look like this:

And that’s it!

Be happy!

These examples were just the tip of the iceberg we can do with Query Tile Pro. I hope I helped you to set it and now your life is easier and your dashboards are more complete. If you have already done even more complex uses of Query Tile Pro, please let me know so I can include here and help more people!