It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Add label to Confluence template based on a Variable

When a new page is created using a template I want a label to be assigned the value of a specific variable on the page so that I can then use the label as a filter in the Page Properties Report.

The scenario is this:

I have a set of pages containing Trade Partners and another set of pages listing all the sales events (conferences etc.) that we attend.

  • In the Events Template I want a Label that equals the content of the PartnerName variable.
  • I then want to have a section in the Trade Partners page that lists all the events this Partner runs.

Is this possible or am I going about it the wrong way?

1 answer

0 votes
Chii Atlassian Team Aug 20, 2019

Templates do not allow variably named labels - they only allow a statically named set of labels. 

Blueprints, on the other hand, allows some programmatic control over the resulting page. In this case, you could potentially add the required labels by listening to the `com.atlassian.confluence.plugins.createcontent.api.events.BlueprintPageCreateEvent`, and checking that the blueprint is the one you're interested in (using `com.atlassian.confluence.plugins.createcontent.events.BlueprintPageCreateEvent#getBlueprint`)

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

How is your team having fun and bonding, remotely, utilizing Confluence?

Thanks everyone for answering last week’s question. The winner of the random drawing from those who commented is: @LarryBrock I’ll contact you separately with your prize details. This wee...

269 views 9 6
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you