I am creating an automation rule that creates a page from a template when another page is created (from a specific template) and as a child page.
I am able to create the automation rule and it functions as intended for everything above except creating the new page (lets call this page "b") under the original page that was created and that triggered the automation (let's call this page "a").
I know the publish new page action does not support creating under the page that triggered the automation BUT I am able to work around that gap by interacting with the confluence rest api through the "send web request" action. I also have the send web request action working, however I need to reference the original page id (page "a") to set as the parent for the new published page (page "b").
I see in the audit log there is a link to associated items which includes the published page.
Is there a smart value I can reference to get the page id of that newly published page in the automation (page "b" in the example above)?
Hi @Julio Verano, if I understand your question correctly and page A is the page that trigger the rule and you create page B within the rule, you can use this smart value to fetch page As ID.
{{page.id}}
TimK.
Thanks Tim for the response!
Actually its the id of the new page created in the automation (page B in my example above) that I am needing to complete this automation - is there a smart value for that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Julio Verano, I have looked deep into this to see if it's solvable.
It seems the page is created long after the rule is completed. Even trying to use webhook to another rule (rule 2) doesn't work because the page published in rule 1 is not even created when reaching rule 2. This concludes that you are not able to fetch the page id for any pages published within a rule. At last, this is how I understand it.
The only idea I have to solve this is as follows:
You will need three rules for this approach, which are all triggered by When: Page published.
First, add a filter needed for your scenario so you don't hit all published pages, but only those needed.
Add action And: Publish a new page, and use a template that contains the label "autocreated_page_b".
Start with a filter If: Compare two values configured as
Then add action And: Publish a new page, use a template that contains the label "autocreated_page_c".
Create action Then: Remove label to remove "autocreated_page_b" from this page as it's not needed any more.
Since you now have the id from page B, using {{page.id}} here in rule 2, you can execute the move of page B using the REST API you mentioned.
Start with a filter If: Compare two values configured as
Create action Then: Remove label to remove "autocreated_page_C" from this page as it's not needed any more.
Since you now have the id from page C, using {{page.id}} here in rule 3, you can execute the move of page C using the REST API you mentioned.
You will need to add labels to your two templates fpr page B and page C up front. You might swap the label names I have used to your own desire.
Since the templates contains labels that passes the filters in rule 2 and 3 you must either
TimK.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.