I've spent some time getting a dashboard together on a project in Azure DevOps. I've got 14 queries backing it up, and 3 different widget types used. Brilliant. The issue I have is that I now need to roll this out to 70+ projects.
I exported all my queries using the WIQL marketplace extension but only seem to be able to import them into the other projects one at a time which is very time-consuming. I'm then needing to match the right query with the right widget in the dashboard, and again it's time-consuming. I've been looking for a way to copy dashboards but one doesn't seem to exist from what I've found.
Can anyone suggest a way that I can cut down the time for this? Even if it's just a way to get my queries across the different projects - that would be a huge time-saving.
I've tried Googling and YouTube as well, but seem to hit a brick wall - perhaps my search terms are wrong? - because I'm directed to pages and instructions on importing work items rather than queries.
In addition to the python script and c# code shared in this ticket, you can also try to use REST API to copy dashboards. Here are the steps:
Get a dashboard by its ID.
GET https://dev.azure.com/{organization}/{project}/{team}/_apis/dashboard/dashboards/{dashboardId}?api-version=6.1-preview.3
Copy the response body of the get dashboard REST API and delete the dashboard id.
Create the supplied dashboard.
POST https://dev.azure.com/{organization}/{project}/{team}/_apis/dashboard/dashboards?api-version=6.1-preview.3
Please paste the response body to the request body in this REST API. You only need to change the project name and team name here to copy to different projects. 4.Currently, some widget settings may get null values , and you may need to manually configure them in new dashboards.
In addition, the product group is developing this feature. Here is the feature timeline. Please track and follow this ticket for latest updates.