How do I initialize the build object? I tried assigning a new Build() to it 
but of course that is abstract so I can't create an instance of it.

I was able to successfully access the Jenkins environment variables however.



Sent from my iPhone
>
>Tuesday, July 29, 2014, 1:29 PM -0400 from Slide  <[email protected]>:
>The Groovy stuff for email-ext is built into the email-ext plugin, no external 
>plugin is necessary for the groovy templates in email-ext.
>
>On Tue, Jul 29, 2014 at 10:24 AM,  < [email protected] > wrote:
>>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 .
>
>--
>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.

Reply via email to