Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Display Confluence page link in custom field if remoteIssueLink contains a string in the title

Rob_Duncan May 7, 2018

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

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events