You probably need to use the rest api to update the task group version in the release pipelines. See below steps:
1, Call Release Definitions - List api to get all the releases' id.
GET https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/definitions?api-version=6.0
2, Call Release Definition - Get api to get the release definition.
GET https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/definitions/{definitionId}?api-version=6.0
3, Update the task group version in the request body and Call Release definition update api.
PUT https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/definitions?api-version=6.0
See below full scripts in powershell:
Change the {Taskid} and its version accordingly. See here to get a personal access token
$listurl="https://vsrm.dev.azure.com/{ogr}/{proj}/_apis/release/definitions?api-version=6.0"
$PAT="Personal access token"
$base64AuthInfo= [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$($PAT)"))
#get the releases' ids.
$result = Invoke-RestMethod -Uri $listurl -Headers @{Authorization = "Basic {0}" -f $base64AuthInfo} -Method get
#loop the ids to get each release's definition
foreach($release in $result.value){
#get each release's definition
$definitionurl="https://vsrm.dev.azure.com/{ogr}/{proj}/_apis/release/definitions/$($release.id)?&api-version=6.0"
$releaseDefinition = Invoke-RestMethod -Uri $definitionurl-Headers @{Authorization = "Basic {0}" -f $base64AuthInfo} -Method get
#loop through each stage
foreach( $environment in $releaseDefinition.environments){
#loop through each tasks to find the task group
foreach($task in $environment.deployPhases.workflowTasks){
# change the 'taskId' to the taskId of your task group
if($task.taskId -eq "{taskId}"){
$task.version = "2.*" # update the taskgroup version to the newest version
}
}
}
$updateurl="https://vsrm.dev.azure.com/{ogr}/{proj}/_apis/release/definitions?api-version=6.0"
# update the release definition
Invoke-RestMethod -Uri $updateurl -Headers @{Authorization = "Basic {0}" -f $base64AuthInfo} -ContentType "application/json" -Method PUT -Body (convertto-json $releaseDefinition -Depth 20)
}
az devops
cli to grab the json for the release definition, search & replace the version and push it back – jessehouwing