Forums

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

Can you update Confluence template variables after publishing?

Logan Hawkes
Contributor
October 19, 2023

I am designing a Confluence template for migration run books. I've created several template variables to be populated by the user, but there is the possibility that some of the information may change. Is it possible to change the value of a template variable post-publication? 

For example: 

  1. The user creates a page using the template. Two of the template variables are:
    1. $newServerIP
    2. $newServerHostname
  2. The user populates the variable $newServerIP with the string "10.12.12.74".
  3. The user leaves the variable $newServerHostname blank.
  4. The user publishes the page.
  5. Subsequently, the user is informed that the newServerIP will be "10.12.12.52" and the newServerHostname will be "jira01.innitech.com".

Short of going into the database, Is there any way to change the values of the variables after publication? 

 

2 answers

2 votes
Rodrigo
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.
October 20, 2023

Good day @Logan Hawkes,

I work with apps, so my apologies if this is too far fetched :D

I have seen the app Scaffolding Templates, which adds the possibility that when the main template is modified, all pages created with said template are also modified.

So, with this crazy idea, you could create (hopefully not too much) templates for each space/team or other classification, and when the time comes, massively update them.

But I can imagine it could be troublesome... Hope it helps as an idea, and possibly to save a few seconds :)

With friendly regards
Rodrigo 

ps. nice profile pic

Logan Hawkes
Contributor
October 24, 2023

That may be the only way. I was really hoping for a native solution so I keep it simple. I'm developing a Jira server migration run book template and hoped to expand it to datacenter then on-prem -> cloud. Using templates seems to require that I have all the data at the beginning. That's not always the case. The IPs and hostnames on my current migration have already changed since my original post. 

Like Rodrigo likes this
Rodrigo
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.
October 26, 2023

I see... My apologies, as at the moment I can only think of this macro method. I'll be crossing my fingers for you to get more feedback, as its an interesting case.

Another possibility, a bit more troublesome but with native apps, would be via excerpt macros.

Perhaps creating landing pages, named after the first variable (or its combination) and using excerpt-includes could be helpful to massively update this field to the respective pages... But of course there is a lot of problematics behind it...

Lastly, perhaps Scriptrunner could help (I am no expert, I just know it has quite a deal of customizations and possibilities).

Best of luck! And if possible, please feel free to share your end solution.
Rodrigo

1 vote
Iman Hashemi
Contributor
December 15, 2023

Hi @logan, Iman here from ServiceRocket, vendor of the Scaffolding app which is now acquired by Appfire.

For your use-case, you can utilize Scaffolding app as mentioned by Rodrigo.

You can create a template (either space or global template) and then add your variables directly to the template inside a HTML table (native feature). Then create your pages using the Live Template macro and any changes to the template will be applied to those pages.

Alternatively, you can define the variables as Scaffolding fields (such as Text Data macro, etc). This way, the field structure is defined on the template but the values need to be provided on the page level by going to Edit Contents screen and entering the values. The caveat here is that, if you may need to update the field ($newServerIP) on the page level.

However if you enter the IP values directly to the template (without using Scaffolding fields), then the changes will be applied to all pages. Depending on whether you are on Confluence Cloud or Data Center, the macro names are different but the functionality of Live Template macro remains the same:

Hope this has been helpful and in case you need any further assistance, feel free to reach out to Appfire support team using this link.

Best,
Iman

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events