Issues function is missing in PostJobContext

Hi Team,

We are trying retrieve the open issues and resolved issues after the successful scan using PostJob hooks. We noticed that we have issues() as part of PostJobContext until version8.0. Using that issues function, we can retrieve all the new issues and resolved issues.

In version9.0, issues function got removed from interface PostJobContext. Is there a way to retrieve the resolved issues and open issues using post scan trigger in version 9.0?

Version 9.0: PostJobContext (sonar-plugin-api 9.0)

Version 8.0: PostJobContext - sonar-plugin-api 8.0 javadoc

Hey there.

As noted in the API documentation, this was deprecated for removal in v7.3. Today – in order to retrieve any analysis results, the analysis must be sent to SonarQube for processing. From there – the Web API can be used to retrieve issues.

What use-case were you using this functionality for previously?

Thanks for your response.
We are actually trying to retrieve all the issues post scan and send it to our internal tool.

@Colin is it possible to retrieve the issues created in the last analysis using web api?

I can retrieve all the issues. But, I couldn’t list retrieve the newly created issues alone.

SonarQube only exposes an issue creation date (which will typically be backdated to when a line of code was last modified). There’s no foolproof way to capture just the new issues found with analysis.

And, hopefully (legitimately new) issues are falling into the New Code Period – and should be the issues that are focused on.

Can you clarify what your internal tool provides that SonarQube isn’t already?