How to get measures from all projects in one call when all projects are at root?

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve
  • what have you tried so far to achieve this

SonarQube Version: 7.9.2

I’m trying to get measurements for all projects in a SonarQube server via Web API Call.
I tried with “api/measures/component_tree” end point but that one needs a base component and, in our case, all project components are root (no ancestors) so I cannot provide a base component for all of them.
Is there a way to obtain in this case measurement data from all projects without doing a call per project?

Thanks

Hey there,

There is not a single API call that will return data for all projects, unless you use the Enterprise Edition and those projects are included in a portfolio. You will need to make individual Web API calls to GET api/measures/component

Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

xxx → 7.9.6 → 8.9.7 → 9.3 (last step optional)

You may find the Upgrade Guide and the LTS-to-LTS Upgrade Notes helpful. If you have questions about upgrading, feel free to open a new thread for that here.

Ok, understood.

Thank you Colin for your help.

Regards