/
Render Just Added Comments during notification processing
Render Just Added Comments during notification processing
This script will gather and render comments just added to event bundle during and outbound notification render that the recipient has permission to view. e.g. Internal Comments are not rendered for Customers.
To render all recent comments that alrleady exist on an issue please see: Render All Comments from Issue
The main difference is the $context.comments
property only stores comment updates i.e. created/deleted that were added during event merging for the event bundle that is finally processed once JEMHC renders the outbound notification.
HTML Render
#set ( $comments = $jemhUtils.filterRestrictedComments($context.comments))
#foreach ($aComment in $comments)
##Your comment rendering velocity below is only an example
<strong>$jemhUtils.getUserDescription($aComment.author)</strong>
<em>$aComment.updated.asText():</em>
<p>$jemhUtils.wikiToHtml($aComment.body.asText())</p>
$jemhUtils.setCommentRendered()
#end
Screenshot of how the comments would appear within the notification (note below is from above example).
Text only?
In the code above instead of calling wikiToHtml
just use:
$aComment.body.asText()