Forum Discussion
Multi-Count Query to power Dashboard Chart
I want to create a dashboard to show the number of items assigned a value in a custom multi-select attribute. For example, a customer field called Facet1 has set values that are multi-select. The values go from Value1 to Value20. I want to create a query that will count the number of epics that have been tagged with each value.
I can create a query that counts the number of a specific value, but I want one that counts all values, which I can use to power a graph on a dashboard. Can you please help me construct a query that counts multiple values and displays them in a dashboard chart? Thank you.
- NewtodevopsCopper Contributor
Kidd_Ip I use the Azure DevOps ticketing system to manage and track an Agile development backlog. I have added some custom fields to the Epic ticket/issue type, and I would like to create a dashboard within the tool to show how many epics are tagged with each attribute in either a pie or bar chart. This is the first time I have used DevOps; I have a lot more experience with JIRA, so from watching YouTube and AI tools, I can successfully create a query to count an individual value with the DevOps query, but I cannot count all.
I have posted the instructions that ChatGTP supplied, but I have been unable to get it to work to count multiple Values:
Step 1: Create a Query to List All Items with Tactics
Open Azure DevOps and Navigate to Boards:
- Go to your Azure DevOps project.
- Select "Boards" from the left-hand navigation panel.
- Click on "Queries."
Create a New Query:
- Click on the "New Query" button.
Set the Query Conditions:
- In the "Query Editor," add the necessary conditions to filter work items with the Tactics field.
- Add a new clause: Work Item Type = [Type] (Choose the relevant work item type, e.g., Epic, Task, User Story).
- Add another clause: Facet1 Contains [SomeTacticValue] (Since multi-select fields might require specific values to be checked, start by checking for any specific value you know exists).
- In the "Query Editor," add the necessary conditions to filter work items with the Tactics field.
Add a Column for Tactics:
- Click on "Column options" to customize the columns displayed in the query results.
- Add the "Facet1" field to the displayed columns.
Save the Query:
- Click on the "Save Query" button.
- Provide a name for your query and save it in an appropriate folder.
Run the Query:
- Click on "Run Query" to execute the query.