Here is an example of an integration of Jira with Confluence. These assume that you have the recommended app link configuration as described on Interacting with other Atlassian Apps. Also, see the examples of integrating Confluence from the Jira perspective.

Creating a JIRA Project

This example hooks up the SpaceCreateEvent, and responds by creating a project in Jira, using the primary Jira application link. See event handlers for more information.

import com.atlassian.applinks.api.ApplicationLinkService
import com.atlassian.applinks.api.application.jira.JiraApplicationType
import com.atlassian.sal.api.component.ComponentLocator
import groovy.json.JsonBuilder

import static

def appLinkService = ComponentLocator.getComponent(ApplicationLinkService)
def appLink = appLinkService.getPrimaryApplicationLink(JiraApplicationType)
def applicationLinkRequestFactory = appLink.createAuthenticatedRequestFactory()

def event = event as SpaceCreateEvent
def space =

def input = new JsonBuilder([
    projectTypeKey: "business",
    projectTemplateKey : "com.atlassian.jira-core-project-templates:jira-core-task-management",
    key: space.key,

def request = applicationLinkRequestFactory.createRequest(POST, "/rest/api/2/project")
    .addHeader("Content-Type", "application/json")

request.execute(new ResponseHandler<Response>() {
    void handle(Response response) throws ResponseException {
        if ( response.statusCode != 201) {
            log.error ("Creating jira project failed: ${response.responseBodyAsString}")
See the Jira REST API documentation for more info on usage.

For how-to questions please ask on Atlassian Answers where there is a very active community. Adaptavist staff are also likely to respond there.

Ask a question about ScriptRunner for JIRA, for for Bitbucket Server, or for Confluence.