How to get overridden pipeline parameter value in email-ext plugin jelly template

3 views
Skip to first unread message

Dave Taylor

unread,
Aug 23, 2019, 4:21:07 PM8/23/19
to Jenkins Users
I have a parameterized pipeline where we send an email during the post.  One of the parameters is for the VHOST we are deploying to.  This parameter has a default value, but can be overridden in the jenkinsfile based on the branch being built.  In the jelly email template, I am getting the environment variables using:

<j:set var="buildenv" value="${build.getEnvironment(listener)}"/>
<tr>
    <td>Deployed to:</td>
    <j:set var="vhost" value="${buildenv.get('VHOST')}"/>
    <td>${vhost}</td>
</tr>

The value for ${vhost} always comes back as the default value, not what was overridden in the jenkinsfile.  I'm pretty certain the value is overridden properly because the application is deployed to the correct vhost on the server.

How can I get the correct value to come through to the email template?

Thanks for any help.
Reply all
Reply to author
Forward
0 new messages