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 <murshed.ahme...@gmail.com> 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 jenkinsci-users+unsubscr...@googlegroups.com. > 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 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. For more options, visit https://groups.google.com/d/optout.