2
votes

I'd like to create a report which is the build status of each of our builds by branch for all the current branches in my Git repository - much like on the right hand side of the the summary page but spanning all build definitions. I'm happy to use the API and create the report myself but I can't seem to find any way to filter the information by branch in the API. Here's the sort of query I want to perform:

https://(instance).visualstudio.com/(Project)/_apis/build/builds?definitions=(definitionID)&sourceBranch=(BranchID)

but sourceBranch doesn't seem to be a valid parameter

1
Are you succeed getting builds by branch name with my solution?starian chen-MSFT
Yep, that's fantastic. ThanksStu

1 Answers

3
votes

You need to specify branchName (replace / to %2F). For example (Dev-v1 branch):

https://XXX.visualstudio.com/[team project name]/_apis/build/Builds?branchName=refs%2Fheads%2FDev-v1&definitions=17