-
Bug
-
Resolution: Not A Defect
-
Major
-
None
-
Plugin_Version:2.38.2
Jenkins_Version:1.605
When I use an HTML template for content of email with ${TEST_COUNTS,var="total"} Token, it is throwing me an exception
groovy.lang.GroovyRuntimeException: Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported):
But the same token is working fine when I use it without a template i.e. when I am sending email without using template
Exception raised during template rendering: Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: SimpleTemplateScript4.groovy: 7: unexpected token: TEST_COUNTS @ line 7, column 220. e:14px; font-weight:bold;\">${TEST_COUNT ^ 1 error groovy.lang.GroovyRuntimeException: Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: SimpleTemplateScript4.groovy: 7: unexpected token: TEST_COUNTS @ line 7, column 220. e:14px; font-weight:bold;\">${TEST_COUNT ^ 1 error at groovy.text.SimpleTemplateEngine.createTemplate(SimpleTemplateEngine.java:125) at hudson.plugins.emailext.plugins.content.ScriptContent.renderTemplate(ScriptContent.java:198) at hudson.plugins.emailext.plugins.content.ScriptContent.evaluate(ScriptContent.java:81) at org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro.evaluate(DataBoundTokenMacro.java:189) at org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:182) at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:233) at hudson.plugins.emailext.plugins.ContentBuilder.transformText(ContentBuilder.java:71) at hudson.plugins.emailext.ExtendedEmailPublisher.getContent(ExtendedEmailPublisher.java:597) at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:476) at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:290) at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:281) at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:233) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721) at hudson.model.Build$BuildExecution.cleanUp(Build.java:193) at hudson.model.Run.execute(Run.java:1797) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240)
If you are using a groovy template, then the syntax is different. TEST_COUNTS(var: 'foo')