Forums

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

Use automation to check page last udpate

Jiecai.Peng
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 23, 2023

Hi Community,

I am trying to create an automation rule that checks whether a Confluence page has been updated within the last hour. I attempted to use a schedule trigger with CQL, but discovered that the schedule trigger in Confluence automation does not support queries.

Is there another way to accomplish this task using Confluence automation?

 

Appreciate your help

3 answers

1 accepted

0 votes
Answer accepted
Trevor Angle
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 3, 2023

Hi @Jiecai.Peng Trevor here from the Confluence automation team. Here is a working example of an automation rule that logs the titles of pages edited within the last hour:

Screenshot 2023-04-03 at 11.44.00 AM.png

 

If you want to access info about the page through smart values, the 'related entities' branch outputs the {{cqlResult}} smart value, which supports these fields:

  • {{cqlResult.title}}
  • {{cqlResult.type}}
  • {{cqlResult.status}}
  • {{cqlResult.id}}

If you need to access other smart value fields, we may be able to find a workaround. Just let me know!

 

Also, if your use case allows it, I would recommend you run the rule less frequently than every hour. If there is any delay in the rule executing, then it is possible for some piece of content that was updated exactly 60 minutes ago to slip through the cracks. For example, you could do the same rule but have it run every day and update the CQL like so: type = page AND lastmodified > now("-1d")

1 vote
Aron Gombas _Midori_
Community Champion
March 24, 2023

@Jiecai.Peng We have built an app that supports custom notifications in a super-flexible way.

You can define a flexible schedule, a CQL query, customize the email template and choose the recipients like this:

Confluence (13).png

The CQL query in your case would be:

updated > now("-1h")

Would this meet your requirements?

0 votes
Riley Venable
Community Champion
March 23, 2023
Yes, there is another way to accomplish this task using Confluence automation. You can use the "Page updated" trigger and add an action to check if the page has been updated within the last hour. You can do this by adding a "Branch" action and setting a condition that checks if the page was updated within the last hour using the "Page updated date" variable and the "Current time" variable. If the condition is true, you can add an action to perform the desired task.
James Totah March 27, 2023

Have you had success with this Automation @Riley Venable I believe Im getting the same error. 

CQL condition
Error in execution:
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.

 

Screenshot 2023-03-27 at 10.26.35 AM.png

Trevor Angle
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 3, 2023

Hi @James Totah I believe that rule will work if you replace the 'CQL condition' component with a 'Branch rule / related entities' component (and use the same CQL query).

The 'CQL condition' is a filter, it is used to stop or continue the rule execution based on the properties of the CQL content that last appeared in the rule. In the case of a scheduled trigger, there is no particular content to check against the CQL query.

The 'related entities' branch is more like a search mechanism, it allows you to find any piece of content you want based on the CQL query. In this case it looks like that is what you're looking for.

Like James Totah likes this
James Totah April 3, 2023

It worked! Thank you!

Suggest an answer

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

Atlassian Community Events