Versions Compared

Key

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

This script will gather and render all comments that the recipient has permission to view. e.g. Internal Comments are not rendered for Customers.

(info) $jemhUtils has online javadoc: https://jemhcloud.thepluginpeople.com/app/static/javadoc/com/thepluginpeople/jemhod/api/ITemplateUtils.html

HTML Render

Code Block
#set ( $comments = $jemhUtils.filterRestrictedComments($context.issue.fields.comment.comments) )
#if ( $comments.size() > 0 )
    $jemhUtils.setCommentRendered()
#end
#foreach ($aComment in $comments)
    <strong>$jemhUtils.getUserDescription($aComment.author)</strong>
    <em>$aComment.updated.asText():</em>
    <p>$jemhUtils.wikiToHtml($aComment.body.asText())</p>
#end

Screenshot of how the comments would appear within the notification

...

Text only?

In the code above instead of calling wikiToHtml just use:

Code Block
$aComment.body.asText()

Previous Comments with a Reference to an attachment

...

Code Block
#set ( $comments = $jemhUtils.filterRestrictedComments($context.issue.fields.comment.comments) )
#if ( $comments.size() > 0 )
    $jemhUtils.setCommentRendered()
#end
#foreach ($aComment in $comments)
    <strong>$jemhUtils.getUserDescription($aComment.author)</strong>
    <em>$aComment.updated.asText():</em>
    #set ($updatedBody$updatedCommentBody = $aComment.body.textValue().replace("[^", "[")) ## Remove the occurrence of "^"
    <p>$jemhUtils.wikiToHtml($updatedBody$updatedCommentBody)</p>
#end