rsennat
(rsennat)
March 16, 2022, 5:54pm
1
Hi,
What is the REST API to get the new code metrics (quality gate ratings, code coverage and other metrics) ?
api/component/measures is providing only all code metrics/ratings.
Please clarify if there are options / ways to get this info.
Thanks
rsennat
ganncamp
(G Ann Campbell)
March 16, 2022, 7:52pm
2
Hi rsennat,
Have you tried this via the UI? The best way to master the API is to perform the desired action via the UI and eavesdrop to see which calls the UI made to accomplish the action.
Ann
rsennat
(rsennat)
March 21, 2022, 7:37am
3
Hi Ann, Sorry, how to try this via UI? I did not get that. Any pointers?
rsennat
ganncamp
(G Ann Campbell)
March 21, 2022, 6:46pm
4
Hi,
I would start by checking your project’s Measures page.
HTH,
Ann
rsennat
(rsennat)
April 11, 2022, 8:27am
5
I later figured out with info here,
SonarQube 7.9 LTS
This is further continuation with Apis for **new code** metrics at portfolio level .
To avail metrics aggregated for new code I redefined some of our application portfolios as Applications and below are few of the observations:
Unlike portfolios, there is no option to define Applications using regular expression & only manual selection is available
I cannot find an api to fetch aggregated ratings for new code even for Application. Below is the api I trying but it is returnin…
Where can I find all possible values for the metricKeys parameter of e.g. the /api/measures/component API? I’ve looked in the web_api, but that only shows a few examples. Googling didn’t turn up a complete list either.
Thanks!
/api/measures/component?component=<comp_name>&metricKeys=security_rating
/api/measures/component?component=<comp_name>&metricKeys=new_security_rating
/api/metrics/search
Similarly for all other metrics.
thanks
rsennat
1 Like