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:
Thanks
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
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.
https://YOUR-DOMAIN.atlassian.net/wiki/api/v2/pagesPOSTAccept: application/jsonContent-Type: application/jsonStep 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/
I recommend this to try this in sandbox or your playbox before.
FYI: Script runner can do this as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.