-1

I'm working on creating set of widgets for dashboard via code using REST api https://learn.microsoft.com/en-us/rest/api/azure/devops/dashboard/widgets/create?view=azure-devops-server-rest-5.0

So, I was able to create the widgets programatically but struggling while configuring the widget to point to certain team and details.

Example: creating Burndown widget using Analytics extention (https://marketplace.visualstudio.com/items?itemName=ms.vss-analytics&ssr=false#overview). I was able to create widget with contributionId and details.

However, can't set the settings to do aggregation of story points over certain sprints. Any help regarding this is appreciated.

Here is the json passed in Create request. Need help on "settings" part.

{ "id": "", "eTag": "7", "name": "Burndown", "position": { "row": 1, "column": 4 }, "size": { "rowSpan": 2, "columnSpan": 3 }, "settings": "", "settingsVersion": { "major": 1, "minor": 0, "patch": 0 }, "artifactId": "", "url": "urlvalue", "_links": { "self": { "href": "urlvalue" }, "group": { "href": "urlvalue" }, "dashboard": { "href": "urlvalue" } }, "isEnabled": true, "contentUri": null, "contributionId": "ms.vss-dashboards-web.Microsoft.VisualStudioOnline.Dashboards.BurndownWidget", "typeId": "Microsoft.VisualStudioOnline.Dashboards.BurndownWidget", "configurationContributionId": "ms.vss-dashboards-web.Microsoft.VisualStudioOnline.Dashboards.BurndownWidget.Configuration", "configurationContributionRelativeId": "Microsoft.VisualStudioOnline.Dashboards.BurndownWidget.Configuration", "isNameConfigurable": true, "loadingImageUrl": "urlvalue", "lightboxOptions": { "width": 900, "height": 700, "resizable": true } }

Uday
  • 151
  • 1
  • 3
  • 15
  • Hi, how the things going? Does the below json sample could help you create widgets successfully now? If yes, you can accept the answer thus other SO users will be able to see whether the solution works. If you still facing some issues, feel free to leave commend here thus I could continue to help you:-) – Frank Wang-MSFT Oct 22 '19 at 08:36

1 Answers1

0

Below are two samples about the settings parts.

1.Set the certain date as the end date.

"settings":"{
    \"teams\":[{
        \"projectId\":\"projectId\",
        \"teamId\":\"teamId\"

    }],
    \"aggregation\":{
        \"identifier\":0,
        \"settings\":\"\"

    },
    \"completedWorkEnabled\":false,
    \"fieldFilters\":[],
    \"stackByWorkItemTypeEnabled\":false,
    \"burndownTrendlineEnabled\":true,
    \"workItemTypeFilter\":{
        \"identifier\":\"BacklogCategory\",
        \"settings\":\"Microsoft.RequirementCategory\"

    },
    \"includeBugsForRequirementCategory\":false,
    \"timePeriodConfiguration\":{
        \"startDate\":\"2019-10-14\",
        \"samplingConfiguration\":{
            \"identifier\":0,
            \"settings\":{
                \"endDate\":\"2019-10-15\",
                \"lastDayOfWeek\":5,
                \"sampleInterval\":0

            }
            }
            },
            \"totalScopeTrendlineEnabled\":true

            }",

2. Set the certain Iteration as the end date.

"settings":"{
    \"teams\":[{
        \"projectId\":\"projectId\",
        \"teamId\":\"teamId\"
    }],
    \"aggregation\":{
        \"identifier\":0,
        \"settings\":\"\"
    }
    \"completedWorkEnabled\":false,
    \"fieldFilters\":[],
    \"stackByWorkItemTypeEnabled\":false,
    \"burndownTrendlineEnabled\":true,
    \"workItemTypeFilter\":{
        \"identifier\":\"BacklogCategory\",
        \"settings\":\"Microsoft.RequirementCategory\"
    },
    \"includeBugsForRequirementCategory\":false,
    \"timePeriodConfiguration\":{
        \"startDate\":\"2019-10-14\",
        \"samplingConfiguration\":{
            \"identifier\":1,
            \"settings\":[
                \"iterationId\"
                ]
                }
                },
                \"totalScopeTrendlineEnabled\":true

        }",
Frank Wang-MSFT
  • 1,367
  • 6
  • 6
  • Thanks Frank for the suggestion. I did try setting up sample widgets in a dashboard and using the existing widgets setting, i deserialised the settings data according model it has. it took some time for me to create settings for 9 widgets. i was looking for library which will make creating settings faster. Appreciate your help – Uday Oct 16 '19 at 18:20
  • There are so many widgets in Azure DevOps and these widgets have different settings. I don't think there are any documents and libraries that will contain all the settings information. In addition, I use the Network tool to catche these settings, and I think you can use it too. Or you can create a suggestion ticket in Developer Community to ask for the documentation about these settings. – Frank Wang-MSFT Oct 17 '19 at 08:29
  • yea, i submitted the suggestion ticket. Let's see. – Uday Oct 22 '19 at 17:40