I’ve been writing a Python script that uses Azure DevOps REST API to automate some steps in regards to the creation of a organization in Azure DevOps.
One of the steps includes creating four new backlog levels, but I don’t seem to find any endpoint in the API that could help me with that task.
For reference, I’m trying to reproduce the steps shown here:
More specifically, in the “Add a portfolio backlog” part of the document.
Can anybody help me? I'm editing through repl.it and using the requests library, if that's helpful.
One of the steps includes creating four new backlog levels, but I don’t seem to find any endpoint in the API that could help me with that task.
To meet your requirement, you can use the following Rest API:Behaviors - Create to add the New Backlog levels.
Rest API:
POST https://dev.azure.com/{organization}/_apis/work/processes/{processId}/behaviors?api-version=7.1-preview.2
Request Body:
{
"inherits":"System.PortfolioBacklogBehavior",
"name":"backloglevelname",
"referenceName":null,
"color": "009CDD"
}
Then it will create new backlog level in Process. You can record the referenceName in the Rest API response
Result:
If you need to add the work item type to the new Backlog level, you can use the following Rest API:
Rest API:
POST https://dev.azure.com/{Organization}/_apis/work/processes/{ProcessID}/workItemTypesBehaviors/{processname.workitemtype}/behaviors?api-version=5.0
Request Body:
{"behavior":{"id":"referenceName"},"isDefault":true}
Refer to the doc to get the Process ID.