Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Groovy templates template is a templating engine for JavaScript. It lets you insert dynamic content in any text through the use of templates. A template contains variables and/or expressions, which get replaced with values when a template is rendered. This is very similar to JSP markup. 

...

Code Block
languagegroovy
linenumberstrue
<% issue.getKey() %>

You could also use $Groovy $some Groovy code, but only for a variable and not when a method is called on a variable. For example:

...

To send an Email to the Voters and Watchers of the issue when the issue is resolved, write this is as the Subject of the Email

Code Block
languagegroovy
linenumberstrue
Hi All,
<% if (issue.assignee)
{%>
The issue <%= issue.key%> has been resolved by <%=issue.assignee%>
<%}
else
{%>
The issue <%= issue.key%> has been resolved
<%}%>
Regards,
<%=issue.get("project")?.getLead()?.getDisplayName()%>

Note (info) Note that you can also "print" to the text: If you would like to print all the components of the project

...