Hi All,
I wish to send some parameter/ variable from the current build job to the
Email template to send it in an email.
I have saved my email template as Manage_Jenkins>> Managed_Files >>
custom_groovy_Email.groovy
in email template, I am trying to use it as follows
<td>Duration:</td>
<td>${build.durationString}</td>
</tr>
<tr>
<td>Cause:</td>
<td><% build.causes.each() { cause -> %> ${cause.shortDescription}
<% } %></td>
</tr>
<tr>
<td>Tool version:</td>
//<td>${ENV(var="MYTOOL_VERSION")}</td>
//<td>${ENV(var:"MYTOOL_VERSION")}</td>
<td>${build.buildVariables.MYTOOL_VERSION}</td>
</tr>
</table>
<br/>
And In the groovy file in job configuration, I have tried setting it like
this
import hudson.EnvVars
import hudson.model.Environment
import hudson.model.*
node{
stage(tool){
//def MYTOOL_VERSION = '1.33'
//evn.MYTOOL_VERSION = '1.33'
def MYTOOL_VERSION = build.getEnvVars()["${MYTOOL_VERSION}"]
}
}
But it does not seem to be working.
Can anybody help me in this regards, Thank you.
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/dba3d9d3-2bfb-4343-96db-4b68156b9391%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.