Please find below code using Web API, this works well and displays below output. The INFO Rules should display only NOSONAR and ignore other Rules. Please suggest what filter has to be added in API to fetch only this 1 Rule (java:NoSonar) from INFO. Other severities works as expected. metricsResponse = httpRequest( url: "${sonarReportUrl}/api/issues/search?componentKeys=${componentKey}&analysisId=${taskId}&branch=${branch}&statuses=${statuses}&severities=BLOCKER,CRITICAL,MAJOR,MINOR,INFO&s=SEVERITY&asc=false&ps=100", authentication: config.credentialsId )
NOSONAR rule is added as INFO in Sonar profile. It displays all open rules of all severities (INFO, MINOR, MAJOR, CRITICAL, BLOCKER), so NOSONAR is also part of big list of INFO.
If you want to restrict which records are returned, you should take a look at the rules parameter youâll find included in the on-board web service documentation (link in page footer).
Youâre not going to be able to alter the web service output except with the use of the facets parameter, which adds data.
yes, I tried rules parameters, like below earlier. The problem is it displays only this particular rule. Along with this, I also want other severities rules to be displayed. Is there a way to add a filter only on INFO severity.
Hi Ann,
Thanks for assisting. I tried below parameters in API query. My INFO displays 10+ count, i need just 1 which is that NOSONAR rule. The problem with below query is - it is not showing other severities for which I donât want to apply this filter.
Please recommend how to pass such a criteria in this query.
Thanks Ann for assisting.
By Severities, I mean - Critical, Major, Minor, Info.
The NoSonar rule has been added as Info in Sonar profile.
The current or actual output is - displays only NoSonar results since the rules parameter is passed with that particular rule. The current Info contains many rules output.
The expected output is - all open issues in Critical, Major, Minor. And from Info only NoSonar results.
The rules parameter in just above query applies filter on all severities mentioned. What I ask for is how to pass a filter on Info only, is this possible.
For this youâre going to have to make two different calls: one for Critical, Major, and Minor issues. And another for //NOSONAR issues. The web service simply isnât sophisticated enough to handle both of those sets in one call.