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

[Linux Internals] My notes about : Static and Dynamic/Shared libraries

Building the Programmer’s Mentality

Leetcode#253. Meeting Rooms II

Enforcing code coverage rule with JaCoCo in Maven lifecycle

A programming Geek vs University

Representation of me (a student) vs the

How to: Viewing which repositories have branch policies on Azure DevOps

Ship and run .Net

Approaches To Problem Solving #4 (Counting Inversions | Segment Tree)

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

How to: Team Projects, Fields, and Picklists Mapping on Azure DevOps

Use a self-hosted agent for the Azure pipeline

Azure DevOps — Replace tokens/key in JSON using File Transform in YAML Pipeline.

💪Azure Bicep Language - Build a WordPress environment using Bicep modules