Sonarqube report generation for jenkins email purpose

Unable to generate Sonarqube report in either csv, pdf, html or excel format for email through Jenkins. Please advise for sonarqube version 7.0

Must-share information:

  • SonarQube 7.0, SonarScanner 3.1.0
  • Generate Sonarqube report for email through Jenkins
  • I tried report issues and pdfreport plugin but it is not working from 7.0.
1 Like

Hi,

That’s simply not available. What are you trying to accomplish?

Ann

I have integrated Sonarqube in Jenkins and need to send email at the end of job execution which includes Sonar scan report. But not finding anything specific for 7.0 version

Hi,
why not the other way around, means let the notification feature of Sonarqube https://sonarhost/account/notifications do the mailing ?
Regards,
Gilbert

Will it always send email as I see the option of email trigger is only when there are new issues or anything new reported assigned.

My requirement is that I need Sonar report with every Jenkins build which includes Sonar scan call also?

Hi,
always when f.e. new issues or or new quality gate status.
Why bother people, when there are no new issues ?
Otherwise there’s for sure a way in Jenkins to create a mail with the link to the sonarqube project.
What kind of Jenkins job do you use ? Classic or pipeline ?
Regards,
Gilbert

Right now it is maven job

Hi,
you may use the contents from Jenkins/workspace/yourjob/.sonar/report-task.txt and create a mail with f.e. the dashboardUrl.

Gilbert

I am facing the same problem… I have to send mails with PDF/ html attachment of sonar report

I have one doubt , here I am using Sonarqube server 8.9.2 and sonar-scanner 4.7.0 but using Jenkins I automated the Sonarqube server and generated the report of analysis as .docx, .csv, .md, .xlsx files .
Now my doubt is for automating the report files as attachment and send mail through Jenkins what plugin is best for it. I need solution asap, could you please help me.

You can use EmailExt Jenkins plugin and then use it in the scripted pipeline in the below way.

emailext (
                          subject: "'${currentBuild.currentResult}': Project name -> '${env.JOB_NAME}'",
                          body: """<p>STARTED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
                            <p><br>Project: '${env.JOB_NAME}' <br>Build Number: '${env.BUILD_NUMBER}' <br> URL of build: '${env.BUILD_URL}'</p>""",
                          to: 'XXX@gmail.com',
                          mimeType: 'text/html',
                          attachLog: true,attachmentsPattern: 'test.zip',
                          compressLog: true,
                          from: 'XXX@abc.com'
                    )

Hi Koteswara Rao, need your suggestion on this - I automated the Sonarqube server and generated the report of analysis as .docx, .csv, .md, .xlsx files, how did you do that can you help me how you have generated analysis report.