Forums

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

Confluence Automation - Edit Page "Failed to save edited page."

Mike Jones June 11, 2025

I'm trying to use Confluence automation to check for pages in my Space that have not been updated recently, and add the {{page.title}} to another page in the same Space in order to create a single page that is a report of pages that need to be reviewed.

I branch on inactive pages, then within the branch I check if the page status is 'Verified' and if it contains a specific label.  Then I use the Edit page action to modify a specific page with the title "Pages to be reviewed" and append the URL and title of the page that needs review using smart values.

It actually seems to work however, it sends me an email and there is an error in the audit log saying "Failed to save edited page."

1 answer

1 accepted

0 votes
Answer accepted
Bill Sheboy
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.
June 11, 2025

Hi @Mike Jones -- Welcome to the Atlassian Community!

Without seeing the specifics of your rule and the audit log details...

I hypothesize that because the rule branches over multiple pages and tries updating the same, specific page repeatedly, the updates are colliding and eventually causing an error.  (Branches over more than one thing run in parallel and asynchronously.)

And so possible workarounds instead of branching would be:

  • Use Lookup Pages to find them and iterate to make one single update to the specific page.  As the lookup action cannot filter on the labels, you would need to add a conditional filter for that part.
  • Use the Send Web Request action and the REST API to perform a CQL search, again making one single update to the tracking page from the web response

 

Kind regards,
Bill

Mike Jones June 11, 2025

Hi Bill - thanks.  That was the missing piece of information for me (branches are async and parallel).  Totally makes sense that it errors out.  I will research Lookup Pages to see if that option will work

Cheers,

Mike J.

Like Bill Sheboy likes this
Mike Jones June 12, 2025

Ok - I am very close.  My automation looks like:temp_confluence_automation.png

"Then: Lookup pages" has a criteria of Last updated more than 1 days ago.

So on my Edit page action, I can loop over the pages and add titles, but I can't seem to get it to only add the page details if the page contains a specific label.  So far I have tried:

 

{{#lookupPages}}
{{#if(labels.contains("name=custom,"))}}
* GOT ONE: {{title}} was last modified: {{dateLastUpdated.format("yyyy-MM-dd HH:mm")}}
{{/if(labels.contains("name=custom,"))}}
{{/lookupPages}}

I have also tried variations on this.

{{#if(labels.match(".*name=custom.*"))}}
{{#if(labels.toString.match(".*name=custom.*"))}}
{{#if(labels.toString.contains("custom"))}}
{{#if(labels.contains("custom"))}}

None of these work either.  the toString - seems to return an empty string.

If I loop over {{#labels}}, and then test for name.equals("custom" ) I can get it to match, but inside the #labels loop I've lost access to the page properties e.g., title and dateLastUpdated... as they are not in scope.

Is there a correct way to format the if statement so that it will check for my "custom" label?

Like Bill Sheboy likes this
Mike Jones June 12, 2025

I did manage to get it to work if I do:

{{#if(labels.name.get(0).equals("custom"))}}

 But that only works if the label is the first one in the list...

Bill Sheboy
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.
June 12, 2025

First thing: well done on the progress you made solving this!

 

With conditional list filtering, we can filter at different scopes.  And as you discovered, filtering inside of the {{#labels}}...{{/}} nested, long-format iteration conceals data from the higher, pages scope.  (This is a known limitation the automation team has not solved for several years.)

 

We can workaround this using inline iteration over the labels' name attribute and then filtering with match(), and finally using the result set count as the condition:

{{#lookupPages}}
{{#if(labels.name.match("(custom.*)").size.gt(0))}}
* GOT ONE: {{title}} was last modified: {{dateLastUpdated.format("yyyy-MM-dd HH:mm")}}
{{/}}
{{/}}

 

Like Mike Jones likes this
Mike Jones June 12, 2025

Thanks so much Bill - that works.

Like Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events