Sample Configuration: Building a Page Tree reflecting the Issue Hierarchy
Goal
We want to explain how to replicate a parent child hierarchy in Jira in your Confluence Page Tree. The Jira standard hierarchy is Epic, Standard Issue Types, Subtask Issue Types.
As a result of this configuration you will have a corresponding Page Tree in Confluence that is hiarachical identical as your Jira issues.
 Instructions
 Instructions
Our example configuration is made for a simple two level hierarchy (Epic, Story).
Custom Field Configuration
- Add a Single Line Customfield ParentIssuePageId 
- The Customfield must be added to the context of your projects and assigned to the issue types 
Autopage Rules
Parent Rule
- Add an Autopage Rule “Epic Hierarchy - Parent Issue Rule” to create pages for the hierarchy level Epic 
Child Rule
- Add an Autopage Rule “Epic Hierarchy - Child Issue Rule” to create pages for the hierarchy level Story 
  See here How to setup an Incoming Webhook
 Use the “Custom Field”-Mode to define the Target Page.
The Customfield “ParentIssuePageId” must have been created in advance.
Jira Automation Rule
API Token Generation
The Automation Rule contains a web request to the Jira API. You need to create a Personal Access Token.
Step 1: Generate an API Token
- Navigate to your User Account. - Open the Security Tab 
 
- Create a new token. - Click on "Create and manage API tokens" 
 
- Configure the token: - Label: Enter a name for your token (e.g., "Jira Automation"). 
- Expiry date: Set an expiration date for the token. You should choose a reasonable period for security reasons. 
- Permissions: Select the appropriate permissions that the token will need to perform actions via the API. 
 
- Generate the token. - Click "Generate" and copy the token. You will not be able to view the token again once you close this screen, so save it securely. 
 
Step 2: Use the Personal Access Token in Jira Automation
- In your Jira Automation rule, when configuring the "Send Web Request" action, set the following HTTP header: - Authorization: Use the Personal Access Token. The format is: - Authorization: Bearer <your-personal-access-token>
- For example: - Authorization: Bearer abc123def456ghi789
 
- Set the Content-Type header: - Add a header: - Content-Type: application/json
 
Step 3: Secure and Manage Your Token
- Treat the API Token as a sensitive credential. Do not share it or expose it in insecure locations. 
- Revoke the token if it is no longer needed or is compromised by going to Profile > Personal Access Tokens and selecting Revoke. 
Jira Automation Rule - Overview
Jira Automation Rule - Detail Configuration
Web Request - Get the Remote Links of Parent Issues
Atlassian Jira API Documentation
Setting the parent issue in the web request to retrieve the parent page:
{base-url}/rest/api/3/issue/{issuek key}/remotelink //replace {issuek key} with smart value {{issue.parent.key.urlEncode}}
{{#webhookResponse.body}}
{{#if(relationship.startsWith("mentioned"))}}
{{object.url.match("pageId=([0-9]+)").replace("pageId=", "").trim}}
{{/}} {{/}}











