How to get code coverage from SonarQube web API

Hi, I want to get the data for code coverage for each portfolio on SonarQube. I was looking through the SonarQube web api (according to: Web API | SonarQube Docs), but couldn’t find code coverage. Is this data available on this web api?

Hi,

Welcome to the community!

We don’t track coverage as a top-level value for Portfolios. You can find it in the Portfolio Measures page broken down for each component. From there, if you really need to retrieve the component values, eavesdropping on the calls the UI makes will get you there.

And would you mind sharing your use case for retrieving this data? It might inform our future development.

 
Thx,
Ann

Hi Ann,

Thank you for your help.

I want to get the code coverage data into PowerBI for a report. Are there any data on the web API that will allow me to calculate the code coverage myself?

Thanks

Hi,

Any time you want to pull data via an API, your best bet is to find where in the UI that data is displayed and eavesdrop to see which calls the UI made to accomplish the action. In this case, you’ll find the coverage data on the Measures page.

 
HTH,
Ann

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.