Getting metrics for components in a specified branch via the API

Hello,

I am using the following code to pull out the metrics I need:
…/api/measures/component_tree?component=PROJECTNAME&metricKeys=ncloc,coverage

However, there are several branches, say Version 1.0 and Version 1.1. How could I, using the API, pull out results for either of them? Thanks a lot

Just to double check, what version of SonarQube are you running?

You sould be able to check the “Show Internal API” box on your Web API documentation and you’ll see that the “branch” parameter can be used.

6.7.2.

Maybe I have overlooked that in the docs. So I’ve just found it in the internal API. Well I thought - as it is a part of the UI - that this function will be guaranteed in the API too…