I want to get the configuration parameters of Options>Integrations from my releases/project. I want get that configuration of all my releases so i can check which ones are missing that configuration.
How can i do that? I've tried and read about az cli, az devops, powershell but still with this need.
Thank you a lot
I've tried using az cli, az devops, powershell invoke-rest, i've already got how to get the "retention policy configuration" but not yet how to check if "enable repor status to boards" is enabled and where are appointing.
How can i get the Options>Integrations configuration parameters from my projects
You need to use the Rest API: Definitions - Get to get the related Integrations configuration in Release Pipeline.
GET https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/definitions/{definitionId}?api-version=7.1
In the Rest API response, you can check the following content:
Report deployment status to the repository host -> publishDeploymentStatus: true/false
Report deployment status to Work -> autoLinkWorkItems: true/false
Report deployment status to Boards -> LinkBoardsWorkItems: true/false
Report deployment status to Jira -> IntegrateJiraWorkItems: true/false
Enable the deployment status badge -> badgeEnabled: true/false
i've already got how to get the "retention policy configuration" but not yet how to check if "enable repor status to boards" is enabled and where are appointing.
You can refer to the following the PowerShell script sample to confirm if the release has enabled option: Report deployment status to Boards and which stages have enabled the option.
$token = "PAT"
$ReleaseDefinitionID = ReleasedefinitionID
$OrgName= "Organizationname"
$ProjName= "ProjectName"
$Getreleasedefinitionurl="https://vsrm.dev.azure.com/$($OrgName)/$($ProjName)/_apis/release/definitions/$($ReleaseDefinitionID)?api-version=7.1"
$token = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$($token)"))
$Getreleasedefinition= Invoke-RestMethod -Uri $Getreleasedefinitionurl -Headers @{Authorization = "Basic $token"} -Method Get -ContentType application/json
#Check if Release has enabled the option: Report deployment status to Boards
$ReportBoards= $Getreleasedefinition.properties.IntegrateBoardsWorkItems.'$value'
$ReleaseName = $Getreleasedefinition.name
if($ReportBoards -eq "True")
{
echo "Release Definition: $ReleaseName has enabled the option: Report deployment status to Boards"
#Check where are appointing
foreach($stagedef in $Getreleasedefinition.environments)
{
$stagename= $stagedef.name
$StageReportBoards= $stagedef.properties.LinkBoardsWorkItems.'$value'
if($StageReportBoards -eq "True")
{
$StageReportEnvironment= $stagedef.properties.BoardsEnvironmentType.'$value'
echo "Report deployment status to Boards option points to Stage Name: $stagename and set Deployment Tyep: $StageReportEnvironment"
}
}
}
else
{
echo "Release Definition: $ReleaseName has disabled the option: Report deployment status to Boards"
}
Result:
Release definition:
Powershell Output: