I am trying to update branch policy of a branch in Azure DevOps repository. I am trying to do it using Rest API calls following documentation from here.
When I run this from Postman, the request completes successfully with status code ‘200 OK’. Upon checking the status of branch policy in Azure DevOps, I am able to see that the option “Limit merge types” is “on”, however, no checkbox is checked under “Allowed merge types:”.
Here is json payload which I used.
POST https://dev.azure.com/{{Org}}/{{ProjectName}}/_apis/policy/configurations?api-version=7.0
{
"isEnabled": true,
"isBlocking": true,
"type": {
"id": "fa4e907d-c16b-4a4c-9dfa-4916e5d171ab"
},
"settings": {
"useSquashMerge": true,
"scope": [
{
"refName": "refs/heads/test_branch_for_policy",
"matchKind": "exact",
"repositoryId": "11223344-480x-4u1h-x16k-112233445566"
}
]
}
}
It seems "useSquashMerge": true
under settings
is not being considered.