Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Automation - Use smart values inside automatically created confluence pages

Fabian Gropp March 18, 2025

I want to use jira automation to create a confluence page every time a release version is created in jira. In additon, I want to use the smart values (e.g. {{version.name}}) inside my confluence page template.

How can I achieve it? If its not possible, how could I achieve something similar (without apps like ARN)?

5 answers

3 votes
Sebastian Krzewiński
Community Champion
March 18, 2025

Hi @Fabian Gropp 

 

What you can do is to create confluence page via rest api in jira automation rule. Then you can use any jira smart values that you want.

 

Regards,
Seba

Fabian Gropp March 18, 2025

Hi Seba,

thanks for your fast reply. The problem here is, that my template is quite complex. This makes it rather difficult to use the rest api with its json like format. So, the workflow have to be something like this:

    1. Create release version inside the project.
    2. This should trigger the creation of the confluence page.
    3. Replace all occurences of release_version_placeholder inside the template with the created release version.

Is there another way? Or an easier way to combine it with the rest api?

 

Sebastian Krzewiński
Community Champion
March 18, 2025

I would do this in below steps:

  1. Create new version
  2. New version will trigger confluence page creation via rest api
    1. page is not created from template
    2. page is created with body that you want
Like # people like this
Fabian Gropp March 18, 2025

Thanks for your reply - seems promising.

How would you create the body content similar to the template?

I could copy the content of the template via the python3 api:
    -> content = page["body"]["storage"]["value"]


But (I guess) the content does not match with the content the web hook would like to receive as body content.

Sebastian Krzewiński
Community Champion
March 19, 2025

I did that by create empty page from template and get content via rest api and use it in page creation. Unfortunately at this moment there is no way to combine create page from template and add new items at the same time.

1 vote
Fabian Gropp March 21, 2025

Hi guys,

many thanks for all the replies!

We found a different solution on how to handle this.

1. We use a third library tool to create the page when a new release is created. From a privacy perspective this is fine, as a template contains only raw data. This tool replaces all placeholders for the release version, including the placeholders inside the generic issue filter.

2. Afterwards we run a script to fill the page with content.

 

1 vote
Lukas Nicolai_Seibert
Atlassian Partner
March 18, 2025

@Fabian Gropp If using an app is an option for you, I think AutoPage could be a really good solution for this use case.

  • It automatically creates Confluence pages from Jira issues based on certain triggers.
  • A trigger could be, as you described, a status change to "released."
  • Confluence pages are automatically populated with information from your Jira issues, such as forms, descriptions, or summaries (e.g., version name).

 

Here you find AutoPage: https://marketplace.atlassian.com/apps/1218503

 

Hope this helps! Feel free to let me know if you have any more questions.

Best regards, 

Lukas 

Fabian Gropp March 18, 2025

Hi Lukas,

thanks for your answer.

It seems like a possible solution on first glance (like ARN). Unfortunately apps as a solution are not possible due to data privacy concerns in general.

 

0 votes
Pasam Venkateshwarrao
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 18, 2025

Hi @Fabian Gropp 

Welcome to the community.Set the condition’s parameters as shown in the screenshot below.

  1. Instead of <Confluence_base_url> put your Confluence instance’s url.
  2. Instead of <Token> put the personal access token you generated in the Base64 format.
  3. In case an anonymous user creates a page, remove the Authorization header.
  4. Set custom data as needed. In the example above the Confluence page title is set as the issue's key by using smart values. 

  5. you can include the description smart value in the custom data

 

     Hope this helps

 

 

 

0 votes
Vishal Biyani
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 18, 2025

@Fabian Gropp 

Trigger: Version Created

Add Component

Create page in confluence

 

Subsequently you can refer to smart value {{createPage}}

Can you see if you are able to make progress with this approach?

snip.png

Fabian Gropp March 18, 2025

Hi Vishal,

thanks for your reply. Unfortunately the work begins right here. I want to use the smart values inside the template itself.

Vishal Biyani
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 18, 2025

@Fabian Gropp 

As I don't have your template, I created a basic template, which has release_version_placeholder in title and release_version_placeholder in body apart from an H1 title. With this complete solution, confluence page is getting created using the template and is release_version_placeholder  is getting replaced by Version# that tigered this automation rule.

Can you check and let me know if this works for you? if not, would you share the template that you are using and elaborate a bit more on what is not working for you?

 

Expanding on the automation above,

Trigger: Version Created

Add Component

Create page in confluence

  • Create the connection and specify the template.

Get Page Id

Use the following code to extract the page ID and save it in the variable `varPageId`:

{{createdPage.url.split("/").get(7)}}

Send Web Request to get content of confluence page

URL: https://your-instance.atlassian.net/wiki/api/v2/pages/{{varPageId}}?body-format=storage

Store Version Number

Save the version number in the variable varPageVersion

{{webResponse.body.version.number}}

Page Content

Replace the placeholder in the page content with the version number and save it in variable varPageContent 

 

{{webResponse.body.body.storage.value.replace("release_version_placeholder", varVersion)}}

Send Web Request to Update confluence page

URL: https://your-instance.atlassian.net/wiki/api/v2/pages/{{varPageId}}

Method: PUT

Web Request Body: Custom data

{
"id": "{{varPageId}}",
"status": "current",
"title": "{{createdPage.title}}",
"body": {
"representation": "storage",
"value": "{{varPageContent}}"
},
"version": {
"number": "{{#=}}{{webResponse.body.version.number}} + 1{{/}}"
}
}

Headers

  • Authorization
  • Accept
  • Content-Type

This successfully updates the confluence page created using a template with the version number.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events