Using JELLY_SCRIPT template with email-ext shows only the literal string, not eht actual email

1,429 views
Skip to first unread message

David Brossard

unread,
May 14, 2013, 7:39:48 PM5/14/13
to jenkins...@googlegroups.com


I have tried to add email notifications into Jenkins but I have been unable to get anything other than the default variables to work. I have tried adding
$CHANGES
${CHANGES}
and both show nothing in the email.
I have tried adding the example: ${JELLY_SCRIPT,template=”html”}
but it just shows literally ${JELLY_SCRIPT,template=”html”} in the email.
Can someone please help me get the syntax correct? Ihave included a screen shot of my config. Here is an example email output from the that config. Notice no changes show up and the literal Jelly string.

DEV-Build and Deploy - Build # 208 - Successful: Check console output at http://myserver:8080/job/DEV-Build%20and%20Deploy/208/ to view the results. ${JELLY_SCRIPT,template=”html”}


Slide

unread,
May 14, 2013, 7:45:48 PM5/14/13
to jenkins...@googlegroups.com
What version of email-ext are you using?


--
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-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Website: http://earl-of-code.com

lata

unread,
May 15, 2013, 7:24:16 AM5/15/13
to jenkins...@googlegroups.com
syntax for variables:
${ENV, var="CHANGES"} where CHANGES is your var name.

jelly scripts can be used v2.9 and above, what version of email-ext is yours? 

Slide

unread,
May 15, 2013, 7:35:07 AM5/15/13
to jenkins...@googlegroups.com
There is also a ${CHANGES} content token, but you can't use it directly in a Jelly script, you would have to retrieve the changes yourself. 


--
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-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

David Brossard

unread,
May 15, 2013, 11:56:14 AM5/15/13
to jenkins...@googlegroups.com
I am using Jenkins 1.514 and the latest Email-ext that I see is actually 2.29 rather than 2.9. Should I expect to see Jelly or Changes content using any of this syntax in my Default Content settings for "Extended E-mail Notification"?

$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:

Check console output at $BUILD_URL to view the results.

${CHANGES}
$CHANGES
${JELLY_SCRIPT,template=”html”}

I get everything up to "view the results." but nothing after.

Thanks


--
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/cR_L24fJ1Og/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.

lata

unread,
May 16, 2013, 12:35:00 PM5/16/13
to jenkins...@googlegroups.com
ah, i didn't know that.

Slide

unread,
May 16, 2013, 12:39:35 PM5/16/13
to jenkins...@googlegroups.com
I would recommend using groovy templates instead of Jelly templates. I added the ability to use the content tokens in the groovy templates in 2.29. You can do something like ${CHANGES()} to use the content of the CHANGES token. It works for things with parameters as well ${ENV(var: "FOO")}.

slide

lata

unread,
May 16, 2013, 12:50:53 PM5/16/13
to jenkins...@googlegroups.com
2.9 is to be read as 2.09, :-)

Slide

unread,
May 16, 2013, 12:51:51 PM5/16/13
to jenkins...@googlegroups.com
Sorry, working on 1 hour of sleep. 2.29

lata

unread,
May 16, 2013, 12:54:40 PM5/16/13
to jenkins...@googlegroups.com
David, how does your 'Editable Email Notification' section of your job config look like? 
what you showed earlier is the global config.

Slide

unread,
May 16, 2013, 12:57:45 PM5/16/13
to jenkins...@googlegroups.com
By the way, I was able to reproduce this issue but then determined that there were invalid characters used in the token. I updated the JIRA item [1] with what I did to get it to work.

slide

lata

unread,
May 16, 2013, 1:18:37 PM5/16/13
to jenkins...@googlegroups.com
oki, it has to be something like that :-)
Reply all
Reply to author
Forward
0 new messages