Teamcity REST API get latest successful build on a branch

I'm using git flow with teamcity as my CI server. I'd like to pull artifacts from the latest successful build on a particular branch.
I can use this url to get the latest build on a branch: http://$teamcity$/httpAuth/app/rest/buildTypes/name:$BuildTypeName$/builds/branch:name:$branchName$
but it fails if the branch name contains '/' (e.g., git flow names branches 'feature/%' and 'release/%').
I've tried url encoding the '/'. For example, if $branchName$> == 'release/branchName' I use /builds/branch:name:release%2F$branchName$).

  • works - /builds/branch:name:develop
  • fails - /builds/branch:name:release%2F$branchName$.

I don't get an api error, but the api result is empty.

Please sign in to leave a comment.