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.
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).
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").
Any hints how I can further troubleshoot this or maybe even how to fix it?
Thanks!
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".)
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:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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.
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.