How to print the sonarscan result in jenkins console output?

I have created a simple app with .net framework and installed Jenkins with all the required plugins, and pipeline is running very well.
I am resulting with SUCCESS status, but I need to develop the script that if the sonarscan result is successful, then it has to do some activity. So how to get the sonarscan result through the node script in jenkins file?

I have tried the following,

def scanResult = sonarScanner.getResult()
if (scanResult == "SUCCESS") {
    echo "SonarScan was successful"

but after the build has been done and the scan completed receive the following error;

no such property : sonarscanner for class:groovy.lang.binding

Please help me to fix this issue.


Welcome to the community!

Take a look at how to pause the pipeline until the Quality Gate is computed.


1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.