Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic connection to a Jira Space

Rob Peters
Contributor
July 13, 2026

Hi,

I our setup we create for each customer project a Jira Space and a Confluence Space, both using the same key. The creation of the Jira Space and Confluence Space is done automatically after the project manager requests a new customer project.  This works just fine, but there is some post processing to be done:

  1. In Jira we need to connect to the correct Confluence Space, which is currently acceptable and not a need to have.
  2. But in Confluence I have a page which contains a JIra Work Items element, which gives an work item overview. Currently  i need to manual configure so it is using the Jira Space with the matching key. This action i like to automate or semi-automate, does anyone have any ideas to help me?

Thanks 

 

2 answers

1 vote
Viswanathan Ramachandran
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
July 13, 2026

hi @Rob Peters 

is your onboarding process driven by external scripts or webhooks? 

Because Confluence Cloud templates don't allow you to type a variable directly into the Jira Macro edit UI, the trick is to use Jira Automation to spin up the page via the Confluence Cloud REST API v2. This allows you to inject the dynamic space key into the raw page content. 

Step 1: Create a Jira Automation Rule

  1. In Jira, go to Project Settings > Automation (or Global Automation if handling multiple projects).
  2. Set your Trigger to whenever the onboarding request finishes (e.g., Project is Created 

Step 2: Add a "Send Web Request" Action
Instead of using the basic Confluence action, add the Send web request action to tap into the Confluence Cloud API.

  • Webhook URL: https://YOUR-DOMAIN.atlassian.net/wiki/api/v2/pages
  • HTTP Method: POST
  • Headers:
    Accept: application/json
    Content-Type: application/json
    • Authorization: Basic (You can generate an Atlassian API token from your account security settings)

Step 3: Configure the Payload (Custom Data)
Set the request body to Custom data and paste the JSON payload below. This dynamically sets up the Jira Work Items macro to look at the exact project key created by your automation:

{
"spaceId": "YOUR_CONFLUENCE_SPACE_ID",
"status": "current",
"title": "YOUR TITLE",
"body": {
"representation": "storage",
"value": "<p>Below is the real-time overview of tasks for this customer project:</p><ac:structured-macro ac:name=\"jira\" ac:schema-version=\"1\"><ac:parameter ac:name=\"server\">System JIRA</ac:parameter><ac:parameter ac:name=\"jql\">project = '{{project.key}}' AND status != Done</ac:parameter><ac:parameter ac:name=\"columns\">key,summary,type,status,assignee</ac:parameter></ac:structured-macro>"
}
}

References :

https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-post

https://support.atlassian.com/jira-service-management-cloud/docs/create-a-send-web-request-step/

https://support.atlassian.com/atlassian-cloud/kb/automate-linking-of-confluence-pages-to-jira-cloud-work-items/

I recommend this to try this in sandbox or your playbox before.  

FYI: Script runner can do this as well. 

 

 

Rob Peters
Contributor
July 15, 2026

Thank you for the suggestion. 

0 votes
Tomislav Tobijas
Community Champion
July 14, 2026

Hi @Rob Peters ,

But in Confluence I have a page which contains a JIra Work Items element, which gives an work item overview. Currently  i need to manual configure so it is using the Jira Space with the matching key. This action i like to automate or semi-automate, does anyone have any ideas to help me?

When do you create this page (containing this macro)? Is this automated straight after creating a space, or is there another way? 

Potentially, AI/Rovo could do an update on this, but if you're on the free plan, I guess this is not an option.

I did a similar thing for the page properties macro, and as Viswanathan said, you'd need to use the REST API to update/configure, but this can become quite tricky and messy as the content body can be... 'chaotic' 🫤

Cheers,
Tobi

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events