I am trying to update a TaskGroup on our on-premise Azure DevOps 2020 server using REST api, but I am getting 500 InternalServerError
{"$id":"1","innerException":null,"message":"Input TaskGroup parameter cannot be null.","typeName":"Microsoft.TeamFoundation.DistributedTask.Server.Ex
ceptions.InvalidRequestException, Microsoft.TeamFoundation.DistributedTask.Server","typeKey":"InvalidRequestException","errorCode":0,"eventId":3000}
The goal is to set visibleRule
which isn't possible from the web interface.
$url = "http://{server}:8080/tfs/{organization}/{project}/_apis/distributedtask/taskgroups?api-version=6.1-preview.1"
$taskGroups = Invoke-RestMethod -Method Get -Uri $url -ContentType 'application/json' -UseDefaultCredentials
$taskGroup = $taskGroups.value | where { $_.name -eq "Deploy Task" }
$input = $taskGroup.inputs | where { $_.name -eq "VersionInternal" }
Add-Member -InputObject $input -MemberType NoteProperty -Name "visibleRule" -Value "1 = 2"
$json = $taskGroup | ConvertTo-Json -Depth 100
$response = Invoke-RestMethod -Method PUT -Uri $url -ContentType 'application/json' -Body $json -UseDefaultCredentials
What's wrong with the request? Is there any log file available? Or any other way to troubleshoot?