Hello!
I'm trying to add Linked issues information to Notification template.
Below is what I thought should be working:
#set ($linkedIssues = $issueLinkManager.getOutwardLinks($issue.getId()))
#if($linkedIssues)
#foreach($link in $linkedIssues)
#if($link.getIssueLinkType().getName() == "Link type name")
#set ($linkParent = $link.getDestinationObject())
#if($linkParent)
#set ($linkParentIssueType = $linkParent.getIssueTypeObject())
#set ($linkParentKey = $linkParent.getKey())
#set ($linkParentSummary = $textutils.htmlEncode($linkParent.getSummary()))
#set ($linkParentIssueIcon = "<a href='${baseurl}/browse/${linkParentKey}'>#renderIssueTypeIcon(${linkParentIssueType})</a>")
#set ($linkParentIssueLink = "<a style='color:${textLinkColour};text-decoration:none;' href='${baseurl}/browse/${linkParentKey}'>${linkParentKey} ${linkParentSummary}</a>")
Label text: $linkParentIssueIcon$linkParentIssueLink
#end
#break
#end
#end
#end
But it's not. $linkedIssues is always empty.
I've tried to add a specific declaration of issueLinkManager via ComponentAccessor as follows:
#set ($componentAccessor = $ctx.get("jirautils").loadComponent("com.atlassian.jira.component.ComponentAccessor", $ctx.getClass()))
#set ($issueLinkManager = $componentAccessor.getIssueLinkManager() )But it still doesn't work.
I would be very grateful for any tips!
Maybe there is a way to get links directly from $issue within Velocity context?