Thanks for your reply Slide. Can I access them right away or do I need a plugin first? I've noticed online that a lot of people refer to the Groovy PostBuild Plugin when it comes to accessing build objects.
Sent from my iPhone > >Monday, July 28, 2014, 7:47 PM -0400 from Slide <[email protected]>: >In the groovy template you have full access to the Jenkins object model, but >there is also a build object that is available to the script automatically >that is the instance of the build (normally inherits from AbstractBuild) that >you can use to get access to the information you are looking for. You can also >use any token inside your Groovy template if you want to, e.g., ENV(var: >'SOME_VAR'), etc. > >slide > >On Mon, Jul 28, 2014 at 4:06 PM, Jarvis < [email protected] > wrote: >>I have a Groovy script that runs whenever I do a build (it is an email >>template) and I was wondering if it is possible to pass the current Build >>number and status to the script . Using the Email-ext plugin I call the >>script with the {$SCRIPT, "template=test"} to include the output of the >>script in the email body, as they say in the documentation of the Email-ext >>plugin, but it doesn't look like I can pass any more parameters. >> >>Is there a library I can import in the Groovy script to access these >>environment variables? Or are they maybe available in a file somewhere? >>Thanks in advance for any tips. >>-- >>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/d/optout . > >-- >Website: http://earl-of-code.com >-- >You received this message because you are subscribed to a topic in the Google >Groups "Jenkins Users" group. >To unsubscribe from this topic, visit >https://groups.google.com/d/topic/jenkinsci-users/7Re2XSmTGQI/unsubscribe . >To unsubscribe from this group and all its topics, send an email to >[email protected] . >For more options, visit https://groups.google.com/d/optout . -- 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/d/optout.
