Forum Discussion
ThisBytes5
Apr 20, 2022Copper Contributor
Build Rest API ignores demands
https://docs.microsoft.com/en-us/rest/api/azure/devops/build/builds/queue?view=azure-devops-rest-6.0#demand If I'm reading the above documentation correctly I should be able to pass a list of dem...
Larsen_B
Jul 05, 2022Copper Contributor
I ran into this exact issue when trying to use the Agent.Name demand in the API call to force a specific agent to run a pipeline. The syntax that actually worked was quite different from the documented one:
For my Agent.Name demand this syntax worked:
{"definition":{"id":"1234"},"demands":[{"value":"Agent.Name -equals agent-01"}]}
For your example this should do the trick
{"definition":{"id":"539"},"sourceBranch":"dev","demands":[{"value":"Massrun -equals True"}]}
This worked in on-prem Azure Devops Server 2020