Using Confluence automation, how would one set up a rule to:
Hi Nathan,
There surprisingly scare information regarding the usage of CQL imho. I was not successful on finding a way to trigger automation with the trigger "Move" page, but I found that if you make the trigger run on Edit OR if you schedule it to run once a day in the following CQL condition
space = "~5cbf3cc8c4966f0ffe44b985" and label IN ("automation") and ancestor in(2341897092)
You will find that it accomplish almost the same outcome. It will looks like this:
If you grab the link to your parent page you can find the space id and the Ancestor page id :
https://xxxxxxxx.atlassian.net/wiki/spaces/<space ID>/pages/<Ancestor page ID>/<Ancestor Title>.
Let me know if this was useful!
Cheers,
Nico.
Hey Nico,
Thanks so much for the comment. It looks like I'm about 95% there. I tried implementing a version of this for some testing (use case: if a page is a child of a certain other page, and it has the "rca" label, then remove the "rca" label):
When I validated that CQL, it confirmed the query was valid and that 19 contents were found (which matches what I expect). However when actually running this rule, I get an error:
No CQL-compatible content found in the rule context; there is nothing to check against the CQL query. The CQL condition component can only follow components that involve CQL-compatible content, such as the blogpost published trigger, the publish new page action, or the related entities branch.
I also implemented a rule closer to your original suggestion (use case: if a page is a child of a certain other page, and does not have the "rca" label, then add the "rca" label):
This had the same problem - while the CQL condition did validate successfully and return the expected number of pages, it did not run successfully and gave the same error message.
In both cases the rule was (as you can see) set up on a scheduled trigger, but I just ran it manually using the "Run rule" button to force an immediate run.
Would appreciate if you have any thoughts!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Interestingly, I noticed that if I change the trigger from Scheduled to Page edited, the rule runs just fine on the page that got edited
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The use case for my "remove the "rca" label from pages with a certain ancestor" rule is that I have a bunch of pages that get moved (not archived in Confluence terms) to a different ancestor annually. One of two things needs to happen - either:
I belive that in Jira automation, I would be able to accomplish the latter by inserting an action of "lookup issues", then a branch applying to all issues found, with an action of "do something" - but it seems like in Confluence I don't have the ability to "lookup pages", "for each page", "remove label"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nathan,
I haven't had the time to test it but if the trigger "schedule " does not work and "Page Edit" does, seems like a bug to me. I 'll update you if I found any new information regarding this when I can test it out myself, in the meantime I suggest you check the feedback platform from Atlassian and evaluate submitting a bug here https://jira.atlassian.com/browse/CONFCLOUD.
Cheers!
Nico.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Nathan Ell and @Nicolas Tagle, Trevor here from the Confluence automation team. Unfortunately the documentation around the CQL automation components is in need of an update, but I think I can explain what's going on here.
It is expected that an error will happen when the CQL condition is used immediately after a scheduled trigger. The condition operates by checking whether the content referenced in the rule matches the provided CQL query. If the content referenced in the rule is matched by the CQL query, the rule continues. If not, the rule stops executing. In the case of the scheduled trigger, there is no particular content being referenced, so the condition has nothing to check. This is why an error occurs.
I suspect that the component you want to use in combination with the scheduled trigger is really the "Branch rule / related entities" component. Think of this branch component as being a way to 'search' for any CQL content you want. It doesn't depend on any content being referenced previously in the rule, so you can use it with the scheduled trigger.
By the way, totally open to suggestions around how we can improve the error messaging to reduce confusion!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.