You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The automation team recently released a new trigger: Project created. Which made me think: what if we could automatically create a new Confluence space when a new Jira project is created? It would save us a lot of time and ensure we always have a Confluence space associated to a Jira project. Let's do it!
We will use Confluence Cloud API to automatically create a new space. Go here to create a new API token:
Save the generated token in a safe place.
Select the Project created trigger:
You can restrict the trigger to a specific project type - you may want the Confluence space to be created only for Software projects.
Then add a Send web request action. This can be a bit complicated, let me break it down for you:
https://yoursitename.atlassian.net/wiki/rest/api/space
Go to base64encode.org to generate your header value. Just type email:apitoken and hit encode. If my email is manon@gmail.com and my API token is 12345, here is how it should look like:
{
"key": "{{project.key}}",
"name": "{{project.name}}",
"description": {
"plain": {
"value": "This space is linked to Jira project {{project.key}}.",
"representation": "plain"}
}
}
We are using a bunch of smart values in the custom data so that, in both our new Jira project and new Confluence space, we have the same key and name. Read more here about smart values you can use.
Almost there! Here is the final Send web request action:
This is optional but I like to add log actions. It will come in handy if you need to debug your rule:
You can use the following smart values:
{{webhookResponse.status}}
Space {{webhookResponse.body.key}} successfully created
Uh oh, something went wrong. Error {{webhook.Response.status}}
Note: if you do add these actions, remember to enable "Delay execution of subsequent rule actions until we've received a response for this webhook" in the Send web request action.
You did it! A new Confluence space will now be automatically created whenever you create a new Jira project:
Manon Soubies-Camy _Modus Create_
Atlassian consultant
Twybee, a Modus Create company
France
250 accepted answers
5 comments