Jelly script for ext-email plugin jenkins

2.1k Views Asked by At

I am wondering if anyone could show me how to do a jelly script that does this:

I have environment variable that is called like this ${ENV, var="Brand1"} This variable will return either true or false. I got 4 diffrent brand variables 1-4

What I need is a Html jelly script that print out this:

*Hi,

Deploy is about to start:

Brands: Here shall the diffrent brands be shown*

How will I write this in jelly?

I have done like this right now but that aint working

<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define">

<jelly:if test="${${ENV, var="Brand1"}.isTrue()}">
Yes  </jelly:if>
<jelly:if test="${!${ENV, var="Brand1"}.isTrue()}">
No
</jelly:if>

</j:jelly>
1

There are 1 best solutions below

0
On

Try this:

<j:set var="buildenv" value="${build.getEnvironment(listener)}"/>
<j:set var="Brand1" value="${buildenv.get('Brand1')}"/>

And after that:

<jelly:if test="${Brand1.isTrue()}"> Yes  </jelly:if>