I am trying to create a custom field that counts the number of links to our external customer support system. I wrote the following off the the IssueLinkManager:
import com.atlassian.jira.component.ComponentAccessor
def issueLinkManager = ComponentAccessor.getIssueLinkManager()
def totalRemaining = 0
def externalLinkMatch = ~/SupportSystemName/
issueLinkManager.getIssueLinks(issue.id).each {issueLink ->
if (issueLink.toString().matches(externalLinkMatch)) {
totalRemaining += 1
}
}
return totalRemaining as Double ?: nullHowever nothing is returning when I do this. Does the IssueLinkManager not access external links? If not what class and method(s) should I be using?