How to retrieve duplicate bugs
This time a short blog about Azure DevOps. I will show you how you can use Extended Analytics OData feed to retrieve the related work items in Azure DevOps within a Power Automate flow. In this example I will use a bug and retrieve the related duplicate bugs from Azure DevOps.
Inspiration
This question from MaheshBohara:
How to get the list of duplicate bugs linked to the primary bug in Azure devops?
Power Users Community thread: Duplicate bugs in Azure devops.
Extended Analytics
Azure DevOps has a great Analytics Service. Recently they added a feature called Extended Analytics with OData, which is still in preview btw. This will give us some great options to interact with Analytics data via (you guessed it) an OData feed.
A quick look through this Analytics service showed that there is an option to query for non-hierarchical links (for example duplicates) in that feed.
Personal Access Token
For this demonstration I am using a Personal Access Token to interact with the Analytics service.
If you want to use the service you can use such a Personal Access Token as well. However, I am still exploring if this is the best way of authentication with this service though. Maybe it is also possible via an App Registration in Azure Active Directory, which sounds a bit better 😛
Flow setup
1. Add a Manually trigger a flow trigger action.
2. Add three Initialize variable actions. Below is a table with the name, type and value for each of the variables.
Name | Type | Value |
---|---|---|
Organisation | String | yourorganisation |
Project | String | FabrikamTravel |
WorkItemId | String | 97 |
3. Add a HTTP action. Use a GET request and the uri from below in the code snippet. In this example we are using Basic authentication with a random user name and the Personal Access Token.
Showing the results
When running this for work item 97 you should see a result like below.
Now suddenly you can filter, select and share. This Extended Analytics OData feed works pretty cool 🙂
Happy testing!