The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Delete a page when an updated/copied version of the page is created

Nikita Aurora
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 14, 2023

Hi Community,

I've built a manual trigger on confluence which when runs, creates a copy of that page on another space with the latest date. However, what I want is that as soon as this copy is created the older versions of that page with older dates should get deleted/archived. I'm trying to create a rule but not sure on what comparison values should I use to compare both the pages to retain the one with the latest date. Right now, the page title is {{content.title}} - {{now.shortDate}} which gives the name of the page with the latest date. Can someone please guide?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Luiz Ricardo Pereira da Silva
Contributor
January 29, 2024

Hello @Nikita Aurora
Using the Action Variable can help you.

Try creating a variable containing the page title {{page.title}}:

image.png
A second variable containing the date of first publication {{page.dateFirstPublished}} or the date of last update {{page.dateLastUpdated}}:

image.png
This will save the information from the triggered page.

image.png
After copying the page, create other variables to store the information from the copied page:

image.png
Use the {{smart values}} condition:

image.png

First value = {{date}}
Condition less than
Second value = {{copydate}}
Create an Advanced branching with the date value of the triggered page:

image.png
Finish by inserting the delete page or archive page action within the Branch:

image.png
In the testing stage of this automation rule, I used the Log Action action to check whether the values were being stored correctly in the variables.
To confirm that each variable is returning a value, simply use Log Action with the name of the variable inside.
This will bring the values of each one to the audit log of the execution.
image.png




Hope I helped you!
TAGS
AUG Leaders

Atlassian Community Events