we recently upgraded our confluence from 8.5.19 to 9.2.6.
After the upgrade, the application links is broken. I mean the application link between Jira and Confluence are connected and pointing to the correct remote resources. But in our code base, we are calling the ApplicationLink service by this call.
def appLinkService = ComponentLocator.getComponent(ApplicationLinkService).
def appLink = applicationLinkService.getPrimaryApplicationLink(JiraApplicationType)
Now our Macros which utilise this invocation are failing with the error: “Cannot invoke method getPrimaryApplicationLink() on null object”.
I would need your assistance on resolving this issue.
Is there a new approach to call the Application Link service without the ComponentLocator?
1 Like
This is how I’m getting it using scriptrunner maybe it will help you.
import com.atlassian.applinks.api.ApplicationLinkService
import com.atlassian.applinks.api.application.jira.JiraApplicationType
import com.onresolve.scriptrunner.runner.customisers.PluginModule
@PluginModule ApplicationLinkService applicationLinkService
def link = applicationLinkService.getPrimaryApplicationLink(JiraApplicationType)
1 Like
Was experiencing the same issue as @KiritiKantamneni mentioned in the description above, and after trying @JakubPieluek’s solution I can confirm it works.
1 Like