Use Comment Entity Properties in Custom Notfication Templates

Since version 1.9.8


It may be desirable to use the Comment Entity Properties that JEMH sets on comments that it creates.  For instance, you may wish to use the address of the Non-JIRA user sender in your notification template.

Usage in Custom Templates

As of JEMH 1.9.8, JEMH's comment entity properties can be accessed via Velocity templates. This exposes several comment properties:








Was this comment sent by a Non-JIRA user?

Boolean value (true or false)


The message ID of the email that resulted in this comment

Message ID, for example: <>


The JEMH profile ID number that processed the comment

Number, for example: 1


Is the comment created by the Default Reporter?

Boolean value (true or false)


The email address of the comment sender

Email address, for example:


The email address of the comment "to" recipient

CSV Email addresses, for example:,


The email address list of the comment "cc" recipients

CSV Email addresses, for example:,


Is the comment a JSD public comment

true if so, otherwise not defeined.

The above property values are retrieved by calling $jemhUtils.getCommentProperties(<comment object here>).getProperty("<property>").  For example:


Velocity Template Example

Here is a small text format that uses the sentByNonJiraUser and from comment entity properties.  This takes the last comment made by a Non-JIRA user and then displays the senders email address, and the comment itself:

#set ($commentList = $allComments.getComments($issue)) #set ($commentToShow = "") #if ($commentList.size()>0) #foreach ($comment in $commentList) #if ($jemhUtils.getCommentProperties($comment).getProperty("sentByNonJiraUser") == "true") #set ($commentToShow = $comment) #end #end This is the last Non-JIRA user comment. It was made by $jemhUtils.getCommentProperties($commentToShow).getProperty("from"): $commentToShow.getBody() #else There are no comments to show #end

In this example, the resulting template output is this:

This is the last public comment. It was made by admin (on behalf of andy@localhost): This is a comment made by a non-JIRA user. Hello!


Want the last comment regardless of who sent it?

Alternatively, the following will show the last comment, only if it is a non-JIRA user who sent it:


Inhibit Notifications if comment was added using an incoming email from JEMH

If you would like to inhibit notifications for all comments that JEMH adds, then you can by having a condition that searches for any JEMH Comment Properties that have been added and if found then it would mean that JEMH added the comment and should be inhibited.

Below is an example script that can be used within Issue Event templates

Related Articles