How to: Process Templates, Work Item Types and Custom Rules Mapping on Azure DevOps

$AzureDevOpsAuthenicationHeader = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$($PAT)")) }$UriOrganization = "https://dev.azure.com/$($Organization)/"  $uriProcess = $UriOrganization + "_apis/work/processes/"$processesResult = Invoke-RestMethod -Uri $uriProcess -Method get -Headers $AzureDevOpsAuthenicationHeader$inheritedProcess = $processesResult.value | Where-Object {$_.customizationType -eq 'inherited'}if ($inheritedProcess.Count -gt 0)
{
Foreach ($process in $inheritedProcess)
{
Write-Host $process.name
}
}
$uriWorkItemTypes = $uriProcess + "$($process.typeId)/workitemtypes/"$workItemTypesResult = Invoke-RestMethod -Uri $uriWorkItemTypes -Method get -Headers $AzureDevOpsAuthenicationHeader        Foreach ($wit in $workItemTypesResult.value)        
{
Write-Host $wit.name
}
$uriRules = $uriWorkItemTypes + "$($wit.referenceName)/rules?api-version=6.0-preview.2"            $rulesResult = Invoke-RestMethod -Uri $uriRules -Method get -Headers $AzureDevOpsAuthenicationHeader            $customRules = $rulesResult.value | Where-Object {$_.customizationType -eq 'custom'}            if ($customRules)            
{
Foreach ($rule in $customRules)
{
Write-Host $rule.name
}
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store