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

  1. PowerShell script will receive the following parameters:
  • $PAT = Personal Access token to connect on Azure DevOps;
  • $Organization = Organization URL to list all Process Templates, Work Item Types and Custom Rules;
  • $Connstr = connection string to Azure SQL Database that stores the report information. To create this report, it’s necessary to create previously an Azure SQL Server and Database and run a script below:
$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
}
}
  • Process Template (1) = Filter report using Process Template field;
  • Work Item Type (2) = Filter report using Work Item Type field;
  • Process Templates, Work Item Types and Custom Rules (3) = List all information about Process Template, Work Item Type, Custom Rule Name, Condition Type, Condition Field, Condition Value, Action Type, Action Field, and Action Value.

--

--

--

Tech Solution Architect Manager na Accenture

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Why 1Password is the best password manager for Windows 10?

Custom ARTIK 710 Images

Analytics on Kafka Event Streams Using Druid, Elasticsearch and Rockset

Aggregation Function in MongoDB

What You Need to Know Before Outsourcing Software Development

Kotlin Object and Companion

[Mal Series #7] C# Quasar RAT

Enable DLSS in games on Linux using Steam/Proton

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
Vinicius Moura

Vinicius Moura

Tech Solution Architect Manager na Accenture

More from Medium

Azure API management Developer portal Migration/deployment using Azure Devops pipeline

Developing a File Sharing Platform using Azure! (PRACTICAL)

Azure AD Role Management

How to: Including a bunch of Work Items on Azure DevOps