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!
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
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"
It looks like you're new here. Sign in or register to get started.