Hi Jan/Dirk,

Tweaking the script worked in charm. Below is the perfectly working script
which gives me the results for any job that has sonarqube integrated or
sonar quality gates integrated.
It might help someone who is in similar boat. I thank a lot lot to you both
for leading me in right direction which helped  in in achieving this.

import hudson.model.*
import hudson.plugins.sonar.*
import jenkins.model.*

// Iterate over all jobs
Jenkins.instance.getAllItems(AbstractProject.class).each {job ->
  def fName = job.getFullName()

  // Iterate over all build wrappers
  if(job.respondsTo('getBuildWrappersList')) {
  for (wrapper in job.getBuildWrappersList()) {
  if (wrapper instanceof SonarBuildWrapper) {
  println(fName + ' has SonarQube configuration.')
  }
  }
  }
  if(job.respondsTo('getPublishersList')) {
  for (String str : job.getPublishersList()) {
    //def str = wrapper
    if(str.contains("org.quality.gates.jenkins.plugin.QGPublisher")){
  println(fName + ' has Quality Gate plugin')
  }
  }
  }
}
println('Done.')

Thanks,
Vijay

On Thu, May 28, 2020 at 1:35 AM 'Dirk Heinrichs' via Jenkins Users <
jenkinsci-users@googlegroups.com> wrote:

> Am Mittwoch, den 27.05.2020, 21:33 -0500 schrieb Jan Monterrubio:
>
> Try printing like this:
>
> println(“${job.getFullName()} has soñar configuration”)
>
>
> The script already has a line for this.
>
> Bye...
>
> Dirk
>
> --
>
> *Dirk Heinrichs*
> Senior Systems Engineer, Delivery Pipeline
> OpenText ™ Discovery | Recommind
> *Phone*: +49 2226 15966 18
> *Email*: dhein...@opentext.com
> *Website*: www.recommind.de
> Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
> Vertretungsberechtigte Geschäftsführer Gordon Davies, Madhu Ranganathan,
> Christian Waida, Registergericht Amtsgericht Bonn, Registernummer HRB 10646
> This e-mail may contain confidential and/or privileged information. If you
> are not the intended recipient (or have received this e-mail in error)
> please notify the sender immediately and destroy this e-mail. Any
> unauthorized copying, disclosure or distribution of the material in this
> e-mail is strictly forbidden
> Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
> Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
> irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
> vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
> Weitergabe dieser Mail sind nicht gestattet.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/32fc3047756383f007e116e41011f3fe021eda88.camel%40opentext.com
> <https://groups.google.com/d/msgid/jenkinsci-users/32fc3047756383f007e116e41011f3fe021eda88.camel%40opentext.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAMrMyDna-bhhN%2Br6wYtGWFfPGNDxfwJRKrv72s9GNtgRsidhfg%40mail.gmail.com.

Reply via email to