Get severity amount

Hi every one, I need get the number of issues by severity using the API of SonarCloud (of the image) by branch

severities

I can get the amount type of issues (CodeSmell, Bug, Vulnerabilites) using: https://sonarcloud.io/api/project_branches/list?project=org-key_projectName and filter by branch with jq.

I only need the number of severities (like the image) and not the detail.

Is any way to get this info by the API Rest?

Thanks!

Hi,

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.

You may also find this guide helpful.

 
Ann

Thanks Ann,

I do something different, but I think is not the most optimal way (I get all the issues with the an API request but this endpoint return a lot of info and I need make a data treatment to get only the OPEN issues and get only severity).

Do you know if is any plan to get that info with an API endpoint or could be considerate?

Thanks again, and for your time!.

Hi,

You can filter the UI to show only open issues and by severity. That call would be a good one to eavesdrop on.

 
:smiley:
Ann