I am using the sonar web api to query the sonar server for violations. Is there a java code to fetch all the Issues/Violations of a particular project in sonarqube? Please, any suggestions?
How to get all the issues- Use 'ProjectIssues' BatchComponent to list all the issues using org.sonar.api.issue.ProjectIssues.issues()
Use @DependsUpon(DecoratorBarriers.ISSUES_TRACKED) annotation on your decorator. This will make sure that the decorator is executed once issues are tracked as stated in the documentation.
Extract from DecoratorBarriers class:
/**
* This barrier is after {@link #ISSUES_ADDED}. The decorators that need to list all issues must be declared
* after this barrier : {@code @DependsUpon(value=DecoratorBarriers.ISSUES_TRACKED)}
*
* @since 3.6
*/
String ISSUES_TRACKED = "END_OF_VIOLATION_TRACKING";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With