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)?
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
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would do this in below steps:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Fabian Gropp If using an app is an option for you, I think AutoPage could be a really good solution for this use case.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Welcome to the community.Set the condition’s parameters as shown in the screenshot below.
Set custom data as needed. In the example above the Confluence page title is set as the issue's key by using smart values.
Hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vishal,
thanks for your reply. Unfortunately the work begins right here. I want to use the smart values inside the template itself.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
This successfully updates the confluence page created using a template with the version number.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.