Try using something like the following script in the Email Ext script
trigger:



def violationsList = []

// Add whichever result Actions we are interested in
violationsList.add(build.actions.find{it.class.name =~
"hudson.plugins.checkstyle.CheckStyle.*ResultAction"})
violationsList.add(build.actions.find{it.class.name =~
"hudson.plugins.findbugs.FindBugs.*ResultAction"})
violationsList.add(build.actions.find{it.class.name =~
"hudson.plugins.pmd.Pmd.*ResultAction"})
violationsList.add(build.actions.find{it.class.name =~
"hudson.plugins.dry.Dry.*ResultAction"})

// get total number of new warnings
def numberOfNewViolations = violationsList.sum{
it.result.numberOfNewWarnings }

// send email if we have new warnings
0 != violationsList.sum{ it.result.numberOfNewWarnings }




hopefully this will help a bit...



On Tue, Jul 9, 2013 at 3:20 PM, Johannes Wienke <
[email protected]> wrote:

> On 09.07.13 14:44 schrieb Ulli Hafner:
> > That why I recommend using the *new* warnings (and not the totals). Then
> you find all new warnings regardless of the total number of warnings.
> >
> > These warnings are shown in the REST report:
> https://wiki.jenkins-ci.org/display/JENKINS/Static+Code+Analysis+Plug-ins#StaticCodeAnalysisPlug-ins-remoteapi
> >
> > Just click the REST link in the bottom right corner of the analysis
> results. The select XML and you will get something like:
> > <checkStyleResult>
> >   <newSuccessfulHighScore>false</newSuccessfulHighScore>
> >   <newZeroWarningsHighScore>false</newZeroWarningsHighScore>
> >   <numberOfFixedWarnings>0</numberOfFixedWarnings>
> >   <numberOfHighPriorityWarnings>0</numberOfHighPriorityWarnings>
> >   <numberOfLowPriorityWarnings>0</numberOfLowPriorityWarnings>
> >   <numberOfNewWarnings>0</numberOfNewWarnings>
> >   <numberOfNormalPriorityWarnings>9</numberOfNormalPriorityWarnings>
> >   <numberOfWarnings>9</numberOfWarnings>
> >   <pluginResult>SUCCESS</pluginResult>
> >   <successfulHighScore>0</successfulHighScore>
> >   <successfulSinceBuild>0</successfulSinceBuild>
> >   <successfulSinceDate>0</successfulSinceDate>
> >   <warning />
> >   <warning />
> >   <warning />
> >   <warning />
> >   <warning />
> >   <warning />
> >   <warning />
> >   <warning />
> >   <warning />
> >   <warningsDelta>0</warningsDelta>
> >   <zeroWarningsHighScore>0</zeroWarningsHighScore>
> >   <zeroWarningsSinceBuild>0</zeroWarningsSinceBuild>
> >   <zeroWarningsSinceDate>0</zeroWarningsSinceDate>
> > </checkStyleResult>
> > Or choose
> http://localhost:8080/job/Warnings/10/checkstyleResult/api/xml?depth=1 to
> see even more details…
> >
> > But you can easily navigate using the model objects in groovy, and
> example is in the email-ext templates.
>
> Ok, thank you very much. This is a good hint how to start.
>
> Cheers,
> Johannes
>
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to