How can I do this right - I want the results from a job I run (I need to 
run a dozen of these in succession and will email devs if one of them 
fails) 

try{ BuildResults = build job: 'testJob'; currentBuild.result='SUCCESS'; } 
> catch(e){ currentBuild.result = 'FAILURE'; } finally { 
> notify_email(BuildResults); }


if i do the above I only get a valid BuildResults in notify_email IF the 
job is successful, 
if it fails it causes an exception saying No such property: BuildResults

currentBuild is useless as it's the pipeline results, not the job results 
which is what I want

I need the try/catch so I can continue to run my other jobs - otherwise 
it'll stop immediately once one job fails

I'm sure there's some syntax I'm missing here, but I'm struggling to find 
it.

Any help you can provide is appreciated.

Regards,

Jesse

-- 
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/d11f9974-8a71-474a-9927-44cb0ab06a42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to