I need to filter through the external links for selected jira issues and where the Page title has the right prefix then display this link in a custom field.
I have the following scripted field running but I cannot get the page title returned when I call getTitle(), it just returns 'page'. The url returns the page ID. How do I get the page title of the Confluence page to return so I can check it contains the string i am looking for?
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.RemoteIssueLinkManager
def sWrite
def issueLinkManager = ComponentAccessor.getIssueLinkManager()
ComponentAccessor.getComponent(RemoteIssueLinkManager).getRemoteIssueLinksForIssue(issue)?.find {
if(it.applicationName.contains("Confluence")){
sWrite = "<a href='" + it.url.toString() + "' target=_blank>"+ it.getTitle() + "</a>"
} else
return null
}
return sWrite