Versions Compared

Key

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

...

Note
titleJIRA Security Applied

The LinkCollection will return the linked issues as the email sender sees them. The sender may not be privileged to view all linked issues in JIRA. If this is the case, the email may not list all linked issues either.

Insert issue links

Add as $!issue.linkCollection. It returns an LinkCollection object which provides methods to explore linked issues, link types, etc.

The LinkCollection contains the linked issues as the email sender sees them. As the sender may not be privileged to view all linked issues in JIRA, the collection will not render issues hidden to the sender. 

To render as HTML add: #parse('templates/emailissue/email/html/issue-links.vm') 
To render as Text add: #parse('templates/emailissue/email/text/issue-links.vm')

To have full control over the rendering of linked issues, insert the below code fragments into your template instead of parsing the rendering methods as above.

Code Block
languagehtml/xml
titleRender issue link information in HTML emails
#set ($lc = $!issue.linkCollection)
#if ($!lc)
 <tr valign="top">
  #if ($!isJIRA61OrLater)
     <th><strong style="font-weight:normal;color:${textSubtleColour};">Links:</strong></th>
     <td>
  #else
      <td style="color:${textColour};font-family:${textFontFamily};font-size:${textSize};padding:0 10px 10px 0;white-space:nowrap;"><strong style="font-weight:normal;color:${textSubtleColour};">Links:</strong></td>
      <td style="color:${textColour};font-family:${textFontFamily};font-size:${textSize};padding:0 0 10px 0;width:100%;">
  #end
    #foreach ($linkType in $lc.linkTypes)
      #set($outwardIssues = $lc.getOutwardIssues($linkType.name))
      #set($inwardIssues = $lc.getInwardIssues($linkType.name))
      #if($!outwardIssues && $!outwardIssues.size()>0)
      <dl>
        <dt><p style="font-weight: bold"></progress>$linkType.outward</p></dt>
        #foreach ($outwardLinkedIssue in $!outwardIssues)
        <dd>
            <div style="display:table;">
              <a style='color:${textLinkColour};text-decoration:none;' href='${baseurl}/browse/${outwardLinkedIssue.getKey()}'>$outwardLinkedIssue.getKey()</a>
              <span style="white-space: nowrap;">$outwardLinkedIssue.summary</span>
            </div>
        </dd>
        #end
      </dl>
        $!outwardIssues.clear()
      #end
      #if($!inwardIssues && $!inwardIssues.size()>0)
      <dl>
        <dt><p style="font-weight: bold"></progress>$linkType.inward</p></dt>
        #foreach ($inwardLinkedIssue in $!inwardIssues)
          <dd>
            <div style="display:table;">
              <a style='color:${textLinkColour};text-decoration:none;' href='${baseurl}/browse/${inwardLinkedIssue.getKey()}'>$inwardLinkedIssue.getKey()</a> <span style="white-space: nowrap;">$inwardLinkedIssue.summary</span>
            </div>
          </dd>
        #end
      </dl>
        $!inwardIssues.clear()
      #end
    #end
  </td>
</tr>
#end

...