How to: Team Settings Mapping on Azure DevOps

Vinicius Moura
3 min readJul 14, 2021

--

This script and report extract all Team Settings (Backlog Levels, Working Days, and Working with Bugs) within the Azure DevOps organization

Many customers that use Azure DevOps prefer to change Team Settings, but when you have different configurations, it’s more complicated to standardized our teams and verifies that everyone uses these same settings. Thinking about mapping Team Settings on Azure DevOps, the following report was created:

An original script is available on my GitHub repository. See below this script:

Let’s go understand each command used.

  1. PowerShell script will receive the following parameters:
  • $PAT = Personal Access token to connect on Azure DevOps;
  • $Organization = Organization URL to list all Team Settings on Azure DevOps organization;
  • $Connstr = connection string to Azure SQL Database that stores the report information. To create this report, it’s necessary to create previously a Azure SQL Server and Database and run a script below:

2. Projects List = uses this REST API to list all Team Projects on Azure DevOps organization

$AzureDevOpsAuthenicationHeader = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$($PAT)")) }$UriOrganization = "https://dev.azure.com/$($Organization)/" $uriProject = $UriOrganization + "_apis/projects?`$top=500"$ProjectsResult = Invoke-RestMethod -Uri $uriProject -Method get -Headers $AzureDevOpsAuthenicationHeaderForeach ($project in $ProjectsResult.value)
{
Write-Host $project.name
}

3. Teams Get All Teams = uses this REST API to list all Teams on each Team Project

$uriTeams = $UriOrganization + "_apis/projects/$($project.id)/teams"    $TeamsResult = Invoke-RestMethod -Uri $uriTeams -Method get -Headers $AzureDevOpsAuthenicationHeader    Foreach ($team in $TeamsResult.value)    
{
Write-Host $team.name
}

4. Teamsettings Get = uses this REST API to get Teams Settings on each Team

$uriTeamSettings = $UriOrganization + "$($project.id)/$($team.id)/_apis/work/teamsettings?api-version=6.1-preview.1"        $TeamSettingsResult = Invoke-RestMethod -Uri $uriTeamSettings -Method get -Headers $AzureDevOpsAuthenicationHeaderWrite-Host $TeamSettingsResult.bugsBehavior

5. Backlogs Get Backlog = uses this REST API to get a backlog level

$uriBackLogLevel = $UriOrganization + "$($project.id)/$($team.id)/_apis/work/backlogs/$($blv)?api-version=6.0-preview.1"                $backLogLevelResult = Invoke-RestMethod -Uri $uriBackLogLevel -Method get -Headers $AzureDevOpsAuthenicationHeaderWrite-Host $backLogLevelResult.name

5. After extract all Team Settings (Backlog Levels, Working Days, and Working with Bugs), this information is stored in a table in Azure SQL.

6. After insert information into a table, I connected this database on Power BI:

  • Team Project (1) = Filter report using Team Project field;
  • Team Name (2) = Filter report using Team Name field;
  • Working with Bugs (3) = Filter report using Working with bugs (Not managed, Requirement, Tasks) field;
  • Backlog Levels (4) = Check if the team uses the available backlog levels;
  • Working Days (5) = Check if the team uses the available working days;
  • Working with Bugs (6) = Check how the team treats bugs in the backlog (like requirements, like tasks, or not managed).

--

--

Vinicius Moura
Vinicius Moura

Written by Vinicius Moura

Tech Solution Architect Manager na Accenture

No responses yet