0

I tried to trigger an email after build and I found hard to display the build details via my jelly script. I am getting error as "Could not parse jelly script:null"

I am getting these issue when I customize this html [ ${JELLY_SCRIPT,template="html"} ] template and run that via server (jenkins_home/email-templates/*.jelly ).

And I want to get Build Duration, Build Timestamp - Could you let me know how can I achieve this ?

In addition , is there any variable defined to get Build status, build artifacts, junit test results ? e.g Like as we use JOB_NAME for getting the project name.

Thanks Ashok

Ashok
  • 1
  • 1
  • 1

1 Answers1

0

I'll assume you are using the Email-ext plugin for sending mails generated from a jelly script (though you didn't specifically name it).

The error indicates that you probably have a null pointer exception somewhere in your script. A good way to debug jelly scripts is described in this so answer - basically you can use the Jenkins script console to test your template after a modification, without having to run a new build.

To get an idea about how to get specific information, you could look into the default templates (which you probably tried to customize), as well as the jenkins documentation, to see what properties/functions an object has.

The examples you mentioned, like the build duration and timestamp should already appear in the default html template delivered with the plugin, see:

<TR><TD>Date of build:</TD><TD>${it.timestampString}</TD></TR>
<TR><TD>Build duration:</TD><TD>${build.durationString}</TD></TR>
Community
  • 1
  • 1
Akos Bannerth
  • 1,964
  • 18
  • 14