Automation not executed even if CQL query test successful

tfellinger November 3, 2023

I've created an automation that runs when a new page is created. I've tried the "if" block and later also tried the "branch rule" conditional to check if the page is under a certain section (I've tried parent and ancestor). If it is, I want to receive a notification using Slack.

Automation_Overview.png

Problem is, even if the query matches here, the automation is not finding the newly created page. When I open the Automation and check the query builder again it still matches the pages correctly (when I add one the counter gets incremented correctly).

Automation_Query.png

I have no idea why this happens...to me it looks like a bug, but I don't have a ton of experience with Confluence Automations so maybe I'm doing something wrong as well. In the audit log I see that the shown evaluated query is exactly the one I use in the CQL selection, but weirdly with an additional AND space in ("foobar").

Automation_Audit_Log.png

Any hints how I can further troubleshoot this or maybe even how to fix it?

Thanks!

2 answers

0 votes
Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 6, 2023

@tfellinger 

The problem

We experience it every day that CQL queries have a few-second latency. If you create a new page or update an existing one (e.g. by adding labels) queries will not return them for awhile. If you wait for 10 seconds, and repeat the query that it will finally return the page!

Atlassian has never explained it, but we think that the search indexes that CQL relies on require a few second to reflect the changes. Until they become consistent again, they may return outdated result (basically the one that relies on the state before the change).

The solution

In your case, you could try if waiting for 10 seconds before you try the CQL will resolve the problem.

(You can wait and block the execution of the automation rule for N seconds by sending a request to an external site which waits for N seconds before responding. I know that there are sites that provide this "functionality".)

0 votes
Kseniia Trushnikova
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 5, 2023

Hi @tfellinger,

I can also reproduce the issue with CQL. Try to use Advanced compare condition instead of CQL:

{{page.parent.id}} equals PAGE_ID

This should work. Here's the rule example:

Confluence Automation - Advanced compare condition.png

I've found the bug ticket https://jira.atlassian.com/browse/AUTO-699 that looks related to the issue you have. Please click This affects my team to increase the bug visibility.

Hope it helps.

tfellinger November 6, 2023

Thanks @Kseniia Trushnikova !

The automation now triggers successfully. The only thing missing now is that I want to notify on all levels of sub pages and if I understand that correctly the "page.parent.id" only acts on the direct parent page as opposed to the "ancestor.id" that would work on all levels of parents, right?

Any way how to make that work with the advanced compare condition you're aware of?

Thanks again for the fast and helpful response!

Kseniia Trushnikova
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 6, 2023

@tfellinger, yes, {{page.parent.id}} only refers to the parent page.

I can't find any smart values for ancestors in the documentation Smart values in Confluence automation... None of them work: {{page.ancestor}} {{page.ancestor.id}} {{page.ancestor.url}}

Seems like smart values for ancestors are not added yet.

Though I'd recommend you to contact the Atlassian support regarding this. I may be missing something.

Like Reiji Sakao likes this

Suggest an answer

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

Atlassian Community Events