Application Link object usage in plugin

I have created a Confluence plugin to provide a macro. Within this macro, I wish to create a JIRA issue and set a number of fields based on stored page properties. I have an Application Link to my JIRA instance and would like to use this object to remotely create the JIRA issue.

From the java macro plugin, how can I retrieve the Application Link object in order to send my request to JIRA?


Hi @michael.r808, not sure this answers your question directly but, first step I wanted to pass on the AppLinks documentation:

There’s been some “prior art posts” about AppLinks on Answers (now Community), e.g., and and

Hope this helps, -nick

Thanks Nick!

I did get this working after sorting out the Spring Scanner versions and using it to inject the ApplicationLinkService into my macro constructor. From there it was straight forward as long as I stuck to 2 legged auth.

Here’s a snippet:

    private final ApplicationLinkService applicationLinkService;
    public createInitiative(final ApplicationLinkService applicationLinkService) { 
    		this.applicationLinkService = applicationLinkService;
    		jiraApplicationLink = applicationLinkService.getPrimaryApplicationLink(JiraApplicationType.class);
                ApplicationLinkRequestFactory requestFactory = jiraApplicationLink.createAuthenticatedRequestFactory();
                ApplicationLinkRequest request = requestFactory.createRequest(MethodType.GET, "/rest/api/latest/issue/test-1");
1 Like

Right on! Good to hear you got going.