Atlassian has two flavours of JIRA and Confluence, cloud and server, and whilst these are mostly comparable, the Cloud version sometimes gets extra functionality which for whatever reason is not made available in the server version. One of these features is the ability to create a linked Confluence space during project creation in JIRA, and in this post I’ll show you how we can emulate this on the server version.
Where is my space?
So you need to create a new JIRA project and create a linked space in Confluence without leaving JIRA? Well, as long as you have JIRA cloud and Confluence cloud, this is pretty simple – just leave the “Confluence space” option on the Create Project dialogue checked, as shown below:
Unfortunately if you have the server version, this functionality is not available. This means you’re stuck with the manual method: Create your JIRA project, then switch to Confluence and create a corresponding space. Wouldn’t it be great if we could replicate the JIRA cloud functionality on our own server?
Let’s get technical!
With a little help from our favourite scripting add-on, ScriptRunner for JIRA, we can add this functionality into the server version.
Most operations within JIRA cause an event to be fired and one of those is the ProjectCreatedEvent, which we’ll be making use of in a scripted listener.
If you haven’t already, install the ScriptRunner add-on into your JIRA instance and then navigate to the Add-ons->Script Listeners screen and click on Custom listener.
Add a note about what this listener does, select All projects from the Project Key selection and then select the ProjectCreatedEvent from the Events list.
Copy the following Groovy script into the Inline script field.
Next, create your project as per normal. Upon successful creation, you’ll be taken to your new project and notified that both a JIRA project and Confluence space have been created.
Finally, click on the link in the notification and verify that your new space is created in Confluence with the same name as your JIRA project!
Don’t forget that to make this all possible, your JIRA and Confluence need to be connected using Application Links.
Are there any similar tips or hacks you’ve implemented? Tell us in the comments below!