API GET api/measures/component - metricKeys limit


we are using SQ 7.9.2 over the Web API:

  • GET api/measures/component
  • metricKeys: “all metrics from the server”
  • get response: {“errors”:[{“msg”:“Unsupported metric type ‘STRING’ for numerical value”}]}

Seems there:

  • is a limit?
  • a wrong error message?


Hello @guwirth,
This is a bug, fixed in SonarQube 8.1. See https://jira.sonarsource.com/browse/SONAR-12728.
As an interim (until you upgrade or 8.1 or higher), you should query all measures except for the metric new_development_cost

Hello Olivier,

Many thanks for the quick reply.

We (and I think most others) use 7.9 LTS. Maybe you can port the fix back to the LTS version.


1 Like

Hello Günther,
As per the ticket I pointed and given its severity there is no plan to backport on 7.9. The workaround I provided (once you get all the metrics from the API, just remove new_development_cost from the list before invoke api/measures/component and it’ll work) seems acceptable, an not having access to this measure does not seem critical.