2
votes

I'm trying to do few things with Azure DevOps projects through Rest API, but I really quickly got stuck.

For example, I want to use the method "Set Board Options", documentation is here https://docs.microsoft.com/en-us/rest/api/azure/devops/work/boards/set%20board%20options?view=azure-devops-rest-5.1

Does anyone have an idea of how to find out which options (and how exactly) I can use? Is there any way to lookup these values in the Azure DevOps portal or somewhere else?

I was trying to use the .Net library (https://github.com/microsoft/azure-devops-dotnet-samples), but the situation there is the same. Method SetBoardOptions exists but takes Dictionary of strings as the first argument and there is no documentation on how to actually fill up this dictionary, which values are possible to use etc.

1

1 Answers

1
votes

This API is in preview so I guess this is the reason why the docs so poor:

enter image description here

After a big search and tries, I think you can change 2 options in the board settings:

1) statusBadgeIsPublic - True or False.

2) cardReordering - 0 or 1.

I success to do it with PowerShell:

$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user,"MY-PAT")))
$headers = @{Authorization=("Basic {0}" -f $base64AuthInfo)}

$URI =  "https://dev.azure.com/{org}/{project}/{team}/_apis/work/boards/{board}?api-version=5.1"

$params = @{
 "cardReordering"="1";
} | ConvertTo-Json


Invoke-RestMethod -Method Put -Uri $URI -Headers $headers -Body $params -ContentType 'application/json'