Our new Appfire Documentation Space is now live!

Take a look here! If you have any questions please email support@appfire.com

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Until 5.0.0 JMWE add-on could set a field or comment an issue using either a Raw Value or the result of a Groovy expression. Starting from 5.0.0, JMWE provides an option to include Groovy templates too. Using this you can template you can output both text and Groovy expression results together. This is very similar to JSP markup. 

To write a simple Groovy code:

<%= some Groovy code %>

To just execute a simple Groovy code:

<% some Groovy code %>


Groovy templates in JMWE are used in:

Groovy template examples:

Write the issue key as a comment to the issue:

Issue key: <%= issue.get("issuekey") %>

Comment an issue based on the priority of the issue

<% if (issue.get("priority").name == "Critical") { %>
The priority of the issue is <%=issue.get("priority").name %>. So Look out!
<% } %>

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

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 that you can also "print" to the text: If you would like to print all the components of the project

<% issue.getAvailableOptions("components").each() {
  print "Component: "+ it.name + "\n"
}
%>
  • No labels