title: Teamcity REST API get latest successful build on a branch
body: <p>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.</p>
  
  <p>I can use this url to get the latest build on a branch: <code>http://$teamcity$/httpAuth/app/rest/buildTypes/name:$BuildTypeName$/builds/branch:name:$branchName$</code></p>
  
  <p>but it fails if the branch name contains <code>/</code> (e.g., git flow names branches <code>feature/%</code> and <code>release/%</code>).</p>
  
  <p>I've tried url encoding the <code>/</code>. For example, if <code>$branchName$&gt; == 'release/branchName'</code> I use <code>/builds/branch:name:release%2F$branchName$)</code>.</p>
  
  <ul>
  <li>works - <code>/builds/branch:name:develop</code></li>
  <li>fails - <code>/builds/branch:name:release%2F$branchName$</code>.</li>
  </ul>
  
  <p>I don't get an API error, but the api result is empty.</p>