which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension)
SonarQube Developer Edition v10.8.1 (101195)
how is SonarQube deployed: zip, Docker, Helm
zip
what are you trying to achieve
Retrieve ‘new code’ metrics from the measures API, e.g. new_violations, new_software_quality_high_issues, etc. I’d essentially like to know for the new code time period / new code version defined for each project, what the number of new issues we have introduced are… much like you can see at a glance through the UI.
You’re right on the money – GET api/measures/search_history retreives historical metrics, of which new_ metrics will not be included. This is what you would see when browsing, say, the Activity tab of your project.
GET api/measures/component retrieves the present values – what you would see when browsing the project dashboard or the Activity tab.
If you ever have any doubt, this guide is useful:
Your version is past EOL. You should upgrade to either the latest version or the current LTA (long-term active version) at your earliest convenience. Your upgrade path is:
Colin Is there a way to distinguish which metrics are New Code metrics using the web_api/api/metrics API? I didn’t see anything in the response indicating this. Should we assume that any metric whose name starts with ‘New’ represents a New Code metric?
I’m a bit confused about whether to use the key or name of the metric from web_api/api/metrics. In some cases, when I use the key, I see historical data coming through — like with “new_development_cost” as key and name is “Development Cost on New Code”
Sorry for not adding context, https://sonarcloud.io/web_api/api/measures/component?deprecated=false§ion=response This api will always send period in response for “New code” metrics?