You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi,
Trying to get this script to return link highlighted:
But can only get:
Confluence (5ee79c44-8e2a-3e22-bb7b-63268d5f5764) https://pmo.sure.com/confluence confluence
Sorry new to this scripting can someone help?
import com.atlassian.applinks.api.ApplicationLinkService
import com.atlassian.applinks.api.application.confluence.ConfluenceApplicationType
import com.atlassian.jira.bc.issue.link.RemoteIssueLinkService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.link.RemoteIssueLink
import com.atlassian.jira.user.ApplicationUser
import org.apache.log4j.Logger
import com.atlassian.jira.issue.link.RemoteIssueLinkStore
def applicationLinkService = ComponentAccessor.getComponent(ApplicationLinkService)
def remoteIssueLinkService = ComponentAccessor.getComponent(RemoteIssueLinkService)
def conf_link = applicationLinkService.getApplicationLinks(ConfluenceApplicationType)?.first()
return conf_link
Hey Kevin,
For remote links to an issue you have to make use of theRemoteIssueLinkManager. So for example if you want to get all the remote links (from your script console) for issue with key ATG-12 and print the application they are coming from, their title and their URL your script will look like
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.RemoteIssueLinkManager
def issue = ComponentAccessor.issueManager.getIssueByCurrentKey("ATG-12")
def remoteIssueLinkManager = ComponentAccessor.getComponent(RemoteIssueLinkManager)
def remoteLinks = remoteIssueLinkManager.getRemoteIssueLinksForIssue(issue)?.collect {"From Application ${it.applicationName}, Title ${it.title}, URL: ${it.url}"}?.join("<br>")
log.debug "Remote Links are $remoteLinks"
Hope that helps,
Thanos
Hey @Thanos Batagiannis [Adaptavist] ,
Is it possible to set the variable remoteLinks above into a customfield through updateValue or setCustomField ?
Could you give me some help please ?
Thanks.
Cassio.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.