For this exercise we need a Jira and a Confluence installed, up and running.
Now in Jira we need to install a free addon called “Easy Integrations for Jira”
Once installed we need to configure it, we need to inform the URL of Confluence and a username and password to do the connection.
Now open two windows, one for Jira and another for Confluence, we need data from the two systems to do the configuration.
In Jira edit a Workflow and in a selected transition add a new PostFunction. In this case the PostFunction called “Create Confluence Page“. At the same time in Confluence select a page to be considered as “template” and get the ID from the “Page Info” option.
We need to inform also the Page ID of the node/page to append the new pages inside
In the below part we can set new Params in Groovy (of course), and this params can be collected and used in the new page in Confluence.
Remember the page title must be UNIQUE in Confluence!! in other words you need to append vars/params in the title like {{issue.key}} {{issue.updated}}
Example of params:
assignee = $issue.assignee or {{issue.assignee}} reporter = {{issue.reporter}} date = $issue.created formattedDate = $DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm").format($issue.created) issueid = $issue.key issuetype = $issue.getIssueType().getName() priority = $issue.getPriority().toString() component= $issue.getComponents().toString() labels = $issue.getLabels().toString() status = $issue.getStatusObject().getName() resolution= $issue.getResolution().toString() brand = $issue.getCustomFieldValue($customFieldManager.getCustomFieldObject('customfield_10705')) website = $issue.getCustomFieldValue($customFieldManager.getCustomFieldObject('customfield_21206')) strategic =$issue.getCustomFieldValue($customFieldManager.getCustomFieldObject('customfield_28407'))
Now publish your Workflow, and to finish we need to set the content of the Confluence Page to get the params! It’s very easy just see this below picture
And works perfect! New “automatic” page created on Transition!
By MrAddon