Welcome
you didn’t reveal your Sonarqube version.
Sonarqube 9.1 comes with a new api/projects/export_findings
endpoint that allows to fetch all issues and hotspots for a given project and a given branch, see
https://jira.sonarsource.com/browse/SONAR-15334
Otherwise with older versions you may use something like that
get total issues via
api/issues/search?componentKeys=com.foo:bar&severities=CRITICAL&ps=1
and then use total = (issues.total.toFloat()/100).round()
in a loop
counter = 1
while(counter <= total)
{
api/issues/search?componentKeys=com.foo:bar&severities=CRITICAL&ps=100&p=$counter
counter++
}
Gilbert