---
title: "Create Confluence Page post function"
canonical: "https://support.appfire.com/space/EI4J/11206783/Create%20Confluence%20Page%20post%20function"
format: markdown
---
> Macro (aura-html)

Easy Integrations offers a post function to generate Confluence pages based on Jira workflow transitions.** **The issue's field/custom field values can be used to generate Confluence pages from templates.

## <span style="color: #000000">Steps</span>

1. <span style="color: #000000">Go to the desired transition within your workflow, switch to the </span><span style="color: #000000">**Post functions**</span><span style="color: #000000"> tab, and click on the </span><span style="color: #000000">**Add post function **</span><span style="color: #000000">link.</span>
2. <span style="color: #000000">Locate the </span><span style="color: #000000">**EIS - Create a Confluence Page**</span><span style="color: #000000"> post function and click the </span><span style="color: #000000">**Add**</span><span style="color: #000000"> button.</span>
3. <span style="color: #000000">Create a name for your post function.</span>
4. S<span style="color: #000000">elect the Confluence connection. There are two options for this:</span>
  - <span style="color: #000000">**Credential**</span><span style="color: #000000">: Choose Credential if you want to use Confluence connection which is defined via the</span> [Easy Integrations Confluence setting](https://confluence.snapbytes.com/display/EI4J/Confluence+Integration)<span style="color: #000000">. If there is no defined credential, this option will not be seen.</span>
  - <span style="color: #000000">**Application Link**</span><span style="color: #000000">: If you want to use the Jira application link then choose this option. If there are multiple application links you can choose an appropriate one and if there is no application link in your Jira, this option will not be seen.</span>
5. <span style="color: #000000">Add a condition for the Confluence page. By default, it can only </span><span style="color: #000000">**return true**</span><span style="color: #000000"> statements which means that the Confluence page will be created. However, you can type your own script in order to programmatically add a condition to create a Confluence page or not. </span>
  <span style="color: #000000">Below is a sample code snippet for a condition that checks the logged-in user should be the reporter of the issue:</span>
6. <span style="color: #000000">For the template, you have two options:</span>
  - <span style="color: #000000">Confluence Templates</span>
  - <span style="color: #000000">Confluence page</span>  
<span style="color: #000000">You can choose any global and space templates or page in your Confluence to be a template for this post function. See </span>[creating a template page with dynamic parameters](https://appfire.atlassian.net/wiki/spaces/EI4J/pages/11206791)<span style="color: #000000">. </span>  
<span style="color: #000000">There is a Confluence Search input in which you can start typing the title of the Template or Confluence Page. </span>

> ℹ️ If you leave the **Space Key **input blank, it will search only global Templates.

![image](media://9ff28ed3-030b-4da8-89a2-1cfe9a23a189)

7. <span style="color: #000000">Similar to the first step, choose the folder (Confluence Page) where you want your Confluence pages to be automatically created.</span>
8. If the template page's ID is stored in a custom field, use the below code in the **Parameters** section to get the value.
  Use the same parameter key (in this example **templateID**) must be used in the ID text input in curly braces (as seen below **{{templateID}}** ).
9. <span style="color: #000000">The page title and content are defined in this section.</span>
  - <span style="color: #000000">**Page Title**</span><span style="color: #000000">: As you know, Confluence does not permit the same page title within the same space. So, adding a unique key to the page (like the Jira issue key) would be wise.</span>
  - <span style="color: #000000">**Request Body**</span><span style="color: #000000">: Leave this blank if you are not an experienced user and you want to follow the standards. Click on the </span><span style="color: #000000">**Load default body to modify**</span><span style="color: #000000"> link if you want to see and change the request JSON body. Otherwise, leave it blank.</span>
  - <span style="color: #000000">**Parameters**</span><span style="color: #000000">: You can define static or dynamic parameters here using Groovy Script. Some sample parameters are shown below.</span>
    A code example is provided below:

10. If you enable the **Update Existing Page** option, the post function will update the Confluence page if it already exists.

### View of the post function

![image](media://ceed2db3-64cd-450a-ac69-e68699f0fbd5)

> 📝 To automatically link the Jira issue and Confluence page, use the Jira macro in Confluence. You can find a demonstration of its usage [here](https://appfire.atlassian.net/wiki/spaces/EI4J/pages/11206791).