Versions Compared

Key

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

...

Code Block
#macro (showLastCommentReverse)
    ##$jemhUtils.log("info", "starting, actionerUser=$actionerUser")
    ##For Each loop which runs backwards through the issues (youngest to oldest)
    #set ($comments = $allComments.getComments($issue))
    #set ($c = $comments.size())
    ##$jemhUtils.log("info", "there are $c comments to render")
    #set ($a = 1)
    #set ($c = $c - 1)
    #foreach($aComment in [0..$c])
        ##$jemhUtils.log("info", "looping with c = $c")
        #if ($c > 0)
            #set ($c = $c - 1)
            #set ($theComment = $comments.get($c))
            #set ($textSubtleColour = "grey" )
            ##$jemhUtils.log("info", "checking comment $c, actionerUserClass=$actionerUser.getClass(), commentClass=$theComment.getClass()")
            #set ($private = $jemhUtils.isPrivateJSDComment($actionerUser,$theComment))
            ##$jemhUtils.log("info", "comment is private : $private")
            #if ($a < 11)
                #if ($private == 'false')
                    #set ($a = $a + 1)
                    #rowWrapperNormalBegin('' 'wrapper-special-margin')
                    <table class="text-paragraph-pattern" cellspacing="0" cellpadding="0" border="0" width="1000%">
                        <tr>
                            <td class="text-paragraph-pattern-container mobile-resize-text " style="padding: 0px; border-collapse: collapse; padding: 0 0 10px 0">                      
                                <div style="color:$textSubtleColour;padding:00F 0 0 0;">
                                    Comment added on $theComment.getCreated() by $theComment.getAuthorFullName():<br>
                                </div>
                                $wikiRenderer.render($theComment.getBody(), $issueRenderContext)
                            </td>
                        </tr>
                    </table>
                    #rowWrapperNormalEnd()
                #end
            #end
        #end
    #end
#end

Rendered

...

...

Rendering an attachment link and embed to the email notification (Jira 8.0.0 +)

The Script below will render an attachment link to the notification where “test.txt” is a placeholder additionally this will embed the file to the notification.

Code Block
 $rendererManager.getRenderedContent("atlassian-wiki-renderer", "[^test.txt]", $issue.getIssueRenderContext())

Rendered:

...

TEXT output

Code Block
$wikiRenderer.renderAsText($lastPublicComment.getBody(), $issueRenderContext)

...