I'm trying to get pipeline run details using definition id using below Rest API
https://dev.azure.com/{organization}/{project}/_apis/pipelines/{definitionId}/runs/?api-version=6.0-preview.1
this is giving me all the details from the specific definition id though I have few local branch off of master for testing purpose. Now when I run this API its gives me all the run details including local branch and master branch.
I want run details only from the master branch I tried using filter like this
&branchName=master or ref=master but it didn't work.
Any help or suggestion would be really helpful.
Thanks in advance.
You need to specify branchName (replace / to %2F). For example (test):
GET https://dev.azure.com/{Org name}/{Project name}/_apis/build/Builds?branchName=refs%2Fheads%2F{branch name}&definitions={Build definition ID}
Sample:
GET https://dev.azure.com/{Org name}/{Project name}/_apis/build/Builds?branchName=refs%2Fheads%2Ftest&definitions=14
Result:

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With