Confluence Automation only running against pages with deactivated authors
Asked by Callum Mardle:

I have configured a very basic Confluence Automation rule, based off the automation in the provided library named "Notify people about inactive pages when scheduled (recurring)". The only change I have made is instead of emailing the author, I am adding to the audit log the following: "{{page.author.name}} - {{page.title}} - {{page.url}}".  

When this runs, it's exclusively returning pages in which the authors are deactivated and not including any that were created by users currently active. When manually searching the space I can see that this automation picking up many more inactive pages (last modified before the specified time period), yet the automation is not picking this up.

I'm not sure if I'm misunderstanding something, or if there's potentially some issues with my permissions within Confluence? I'm the admin of the Space I am running the rule against but not an admin of the entire workspace would that have any affect?


Answers:
author: Aron Gombas _Midori_
body: [@Callum Mardle](/t5/user/viewprofilepage/user-id/1998085) I noticed that you are using a little different component for branching than what Atlassian uses in their tutorial video.

In your screenshot I can see that you are suing "Branch rule / for each page" and your condition is configured through the drop-down. In [Atlassian's tutorial video](https://www.youtube.com/watch?v=Lhv57nyVQWA) (similar use case, at least the filtering part is nearly identical!) they use this:

![How-to-surface-outdated-Confluence-pages-for-review-with-automation-YouTube.png](https://community.atlassian.com/t5/image/serverpage/image-id/258047i328017C580BEC5AF/image-size/large?v=v2&px=999 "How-to-surface-outdated-Confluence-pages-for-review-with-automation-YouTube.png")

I suggest you try to follow the video and see if that works?

comments: author: Callum Mardle
body: Thank you [@Aron Gombas _Midori_](/t5/user/viewprofilepage/user-id/502447) , that's solved it! I wonder if the one in the confluence library should be changed to this, as it seems to not do what it should? Either way, thanks for your help.


author: Aron Gombas _Midori_
body: [@Callum Mardle](/t5/user/viewprofilepage/user-id/1998085) I implemented that rule a few months ago, but for me, the smart values were not working in the email. Are those resolved to their real values for you?

(In my case, they were replaced with blank string, making the rule near useless. I am not sure if it is a bug which has been resolved in the meanwhile...)


author: Callum Mardle
body: [@Aron Gombas _Midori_](/t5/user/viewprofilepage/user-id/502447) I think there is a bug, I tried audit logging the values as well as sending an email containing them and both times it was replaced with empty values. As a workaround, I then tried using the action \`Add label\` (with the audit log action also still present), and that successfully added labels to the matching pages - weirdly enough, the values were then successfully printed to the audit log. Doesn't make much sense why it would do that!


author: Aron Gombas _Midori_
body: [@Callum Mardle](/t5/user/viewprofilepage/user-id/1998085) Yep, it is weird, but that was my conclusion, as well. And, as you can't render dynamic content (not even a page title) to the notification email, it is nearly useless in its current shape...


author: Aron Gombas _Midori_
body: [@Callum Mardle](/t5/user/viewprofilepage/user-id/1998085) If you are interested in alternatives, we are developing the app called [Better Content Archiving](https://marketplace.atlassian.com/apps/123/better-content-archiving-for-confluence?hosting=cloud&tab=overview) which implements its own automation concepts, but it isn't a generic Swiss army knife type app like Automation for Confluence.

It focuses on automating content lifecycle management (incl. content status tracking, analytics, reports, expiration tracking, content archival and disposal, custom email notifications, etc.).

![better-content-archiving-confluence-cloud-notifications.gif](https://community.atlassian.com/t5/image/serverpage/image-id/258321i324BEA1CAEFC9EB0/image-size/large?v=v2&px=999 "better-content-archiving-confluence-cloud-notifications.gif")

Your notification use case can be implemented like this:

**1.** Configure the "Expired" status with this CQL:

```
arch.event.lastUpdatedOn < now("-30d")
```

(It change all pages older than the given period to the "Expired" status.)

**2.** Configure a notification with your preferred schedule, this CQL and your recipients (users, groups, last modifier, etc.):

```
type = page and arch.status = "Expired"
```

It will execute the CQL query with given schedule, compile a personalized email to each recipient (everyone will receive only the pages he can see and he is responsible for) and send that.

The app does a myriad of other things, check out the [documentation](https://www.midori-global.com/products/better-content-archiving-for-confluence/cloud/).


author: Trev Angle
body: Hi [@Callum Mardle](/t5/user/viewprofilepage/user-id/1998085) could you share a screenshot of your rule configuration, and the latest audit log entries? I am not sure why this would be happening, but my suspicion is that there is a condition in your rule that is matching only deactivated accounts.

comments: author: Callum Mardle
body: Hi [@Trev Angle](/t5/user/viewprofilepage/user-id/5027568), thanks for getting back to me. See below for the screenshots, I can't see any reason for the rule to only be matching deactivated accounts.

![2023-05-18_09-31.png](https://community.atlassian.com/t5/image/serverpage/image-id/258003iAA179385AF442AE0/image-size/large?v=v2&px=999 "2023-05-18_09-31.png")![2023-05-18_09-32.png](https://community.atlassian.com/t5/image/serverpage/image-id/258004i906E077F45A350A8/image-size/large?v=v2&px=999 "2023-05-18_09-32.png")![2023-05-18_09-32_1.png](https://community.atlassian.com/t5/image/serverpage/image-id/258005iF464C999ED7EB3AE/image-size/large?v=v2&px=999 "2023-05-18_09-32_1.png")![2023-05-18_09-36.png](https://community.atlassian.com/t5/image/serverpage/image-id/258007i35EABFB73CAB1D42/image-size/large?v=v2&px=999 "2023-05-18_09-36.png")


author: Sheerine Baucum
body: [@Callum Mardle](/t5/user/viewprofilepage/user-id/1998085) Is it possible that only pages that meet this criteria were created by deactivated users or do you have other pages that meet the criteria for active users that you're aware of?


author: Callum Mardle
body: [@Sheerine Baucum](/t5/user/viewprofilepage/user-id/4751651) I thought the same but double checked using the search and could see many many more. After using [this tutorial video](https://www.youtube.com/watch?v=Lhv57nyVQWA) I used "branch rule/related entities" and that solved it, and as expected 100+ pages were returned.


Tags: automation

cloud

confluence-cloud