Groovy Template is a templating engine for JavaScript. It lets you insert dynamic content into 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.
...
Groovy templates in JMWE are used in:
- Comment issue and Comment linked related issues post-function to create the body of the comment by selecting
Groovy template
as theComment type
- Create/Clone issue(s) post-function to:
- Set fields of the new issue by selecting
Groovy template
as theValue type
- Add a comment to the current issue by selecting
Groovy template
as theComment type
- Set fields of the new issue by selecting
- Set field value and Set field value of linked related issues post-functions to set a field value by selecting
Groovy template
as theValue type
- Email issue post-function to write the
Subject, HTML body and Text body
- Link issues to the current issue post-function to write the
JQL search expression
...
For single-statement expressions, you can also use the following shortcut:
Code Block | ||
---|---|---|
| ||
${issue.getKey()} |
To simply execute a Groovy code and not output the result, write your Groovy code as <% some Groovy code %
>. For example:
...
Note that you can also "print" to the text: If you would like to print the components of the project:
Code Block | ||
---|---|---|
| ||
<% issue.getAvailableOptions("components").each() { print "Component: "+ it.name + "\n" } %> |
...