Is there a way to automatically add a label to a page upon creation. We are wanting to create a retention policy for our site that has a number of settings. For each space we would want a default retention policy label applied to each page. So:
Space A: all pages default to rrpolicy1
Space B: all pages default to rrpolicy2
Space C: all pages default to rrpolicy1
I can, with the cli, add a label to each page in a give space through a programmatic method, but newly created pages will not automatically get the new label.
Thanks in advance,
You can do this. What you will want to do is create a new page template within each space. In the template you would include any labels that you wanted. Once created you can click the 'promote' link which will cause the template to be at the top of the list of options when creating a new page.
When someone goes to create a new page within this space, they would simply choose this template to create their page, and the correct labels would automatically be added.
I hope this is what you were looking for.
Is there a way to edit the default templates to simply add a label to them? I really do not know how to recreate the Blog post, decision, etc. pages so that there is a duplicate of each one with a new label. Also is there a way when the page is created to not allow the users to delete the label? IE can I lock the label?
You could also solve it by building a dead-simple Confluence plugin that contains nothing else but an EventListener. The listener should intercept the "page created" events and add the labels trivially.
Another option to consider is to use the Archiving Plugin to implement your retention policies, instead of rolling out some custom solution. With this you can set up policies per space, according to your requirement. Make sure you check it.
An older screenshot about the config options:
Another option would be to install the Label Tools addon from Adaptavist (https://marketplace.atlassian.com/plugins/com.adaptavist.confluence.labeltools), which contains the add-label macro.
Then you would need to get this to display on every page in the space. If you are still using the documentation theme, then you can just add the macro in wiki markup format in either the header or the footer:
Or, if you are using the default theme, you will need to change the page layout for the space and add the following line somewhere in the decorator:
Then newly created pages should have the label added to them.
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.Read more
Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs