Trigger based on the use of a template

Ruud Ravensbergen February 15, 2024

I try to have a trigger performed if a page is published on the basis of the content of the label. However, the page is created using a page template. It seems that the label does not yet exist when publishing, because I get an empty variable back. This should actually be filled with the label that I was added to the page template.

Can I make a script in a different way that will run automatically when saving a page made using a template? 

1 answer

0 votes
Barbara Szczesniak
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.
February 16, 2024

@Ruud Ravensbergen I have found that labels added to a template do not get transferred to the pages created from it.

You could add placeholder text to the template instructing the creator/writer of the page to add the specific label to the page. (You can add a label to a page while in Edit mode; this command is available even before you publish the page the first time.)

You can also set up a rule to add the label to the page—see this post: https://community.atlassian.com/t5/Confluence-questions/Automation-Query/qaq-p/2593156 

Note that the publish page trigger is only triggered the first time the page is published. If you want the trigger to fire every time the page is published, I think you need to use the page update action, instead of publish—I've seen recent posts describing this, but can't find any at the moment to point you to.

Ruud Ravensbergen February 16, 2024

Thank you for your answer @Barbara Szczesniak
But it is precisely the intention that the template arranges everything for those who use the template. Adding and label can easily be forgotten and then the trigger does not work.

I really need a trigger to send a e-mail from this specific template at the first time it is published. And only at the first time 

Barbara Szczesniak
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.
February 16, 2024

You might be able to use the automation rule to add the label that is described in the question I linked to above. This would just require that the pages created from the template all contain specific text (that is not used on other pages, I guess). I think that text could be multiple words to make it more unique.

I'm not sure if WHEN: Page edit includes the first edit when creating the page. I'm on the free plan, so I don't have the Automation feature.

Ruud Ravensbergen February 16, 2024

Thanks, I will try it.

 

Suggest an answer

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

Atlassian Community Events