Tutorial: Configure a Confluence Cloud Template

Follow the steps to configure and run the Create a Confluence Cloud Page When a Jira Issue is Created template.

Admins only!

You must have admin privileges to set up the webhook in your Jira Cloud instance (Step 8).

  1. Click Templates in the left-hand navigation options. 
  2. Click Confluence Cloud.

    All templates for Confluence Cloud filter down and appear on the ScriptRunner Connect screen.

  3. Click the Create a Confluence Cloud Page When a Jira Issue is Created template. 
    A read-only version of the template appears, which includes overview, setup, and usage details.

  4. Click Create a Workspace.

    The New Workspace dialog appears.

  5. Review and update the Workspace name, Description, and Add to a team details, then click Create.
    A success message appears, and the template workspace opens in the Resource Manager, where you can configure API connections before you run the script.

  6. Create and authorize a new Confluence Cloud connector in the workspace.
    1. Click New API Connection for Confluence Cloud.

      The Edit API Connection dialog appears.

    2. In the Uses Connector field dropdown, click Create New.
      The Manage Connector dialog appears.

    3. Enter a name for the connector, then click Authorize.

      A new Atlassian tab opens and prompts you to choose a site (or instance) to authorize and give ScriptRunner Connect proper permissions.

    4. Choose a Confluence site (or instance) to connect to ScriptRunner Connect, then click Accept.
      The Atlassian tab closes, and the Authorize Confluence Cloud Site dialog appears.

    5. In the Site field dropdown, reselect the intended Confluence Cloud site or instance, then click Confirm.

      The Manage Connector screen reappears, and the save option is active.

    6. Click Save to complete the API connector authorization process. 

      The Manage Connector dialog closes.

    7. Click Save on the Edit API Connection dialog to add the newly authorized API connection to the workspace.

      A success message appears.

  7. Configure a Jira Cloud event listener in the workspace.
    1. Click the Event Listener for Jira Cloud.

      The Edit Event Listener dialog appears.

    2. Ensure the first two fields are as follows:
      1. Listener Event Type is set to Issue Created
      2. UsesExistingScript is set to OnJiraCloudIssueCreated

    3. In the Uses Connector field dropdown, click Create New.
      The Manage Connector dialog appears.

      Does your Jira Cloud event listener already exist?

      If the event listener you want to use already exists, select it and skip to Step 7h.

    4. Enter a name for the connector, then click Authorize.

      A new Atlassian tab opens and prompts you to choose a site (or instance) to authorize and give ScriptRunner Connect proper permissions.

    5. Choose a Confluence site (or instance) to connect to ScriptRunner Connect, then click Accept.
      The Atlassian tab closes, and the Authorize Confluence Cloud Site dialog appears.

    6. In the Site field dropdown, reselect the intended Confluence Cloud site or instance (if necessary), then click Confirm.
      A success message appears. The Manage Connector screen reappears with a service URL, and the save option is active.

    7. Click Save to complete the event listener authorization process.
      A success message appears.

    8. Click Save to save the event listener to the workspace.

      Instructions to set up the webhook in Jira Cloud appear on the screen.

  8. Set up the Jira Cloud webhook by following the instructions in ScriptRunner Connect, then return to ScriptRunner Connect and click Done

    The webhook is complete. 

    ReadMe! 👀
    If you ever find yourself lost in a template-setup process, review the ReadMe information for high-level details on how to succeed.
  9. Click the OnJiraCloudIssueCreated script.


  10. Highlight TEST in the CONFLUENCE_PAGE parameter, and replace it with the Confluence page key of the parent page you want the new pages to be created under.

    Copying the Confluence Cloud page key 🔑

    In Confluence Cloud, the page key is a string of numbers (and sometimes other characters) in the URL before the page title. Only copy the numbers and characters between the slashes. 

  11. Click Save in the Resource Manager to save the script changes.
    Now a new Confluence child page will be created in your desired Confluence space each time a Jira ticket is created in the connected Jira instance.

    Make it your own! 🪄

    You can edit the script to further define and customize which details from the Jira ticket are collected onto the Confluence page.