How can I hide the page history for non-logged people
Asked by Dagmar Cervenkova:

Hello,

we would like to publish our documentation and I haven't found anywhere that people who get to our wiki can't access to the page history.

![Sni?mek obrazovky 2023-06-02 v?10.52.53.png](https://community.atlassian.com/t5/image/serverpage/image-id/260906i8D613587D8240D65/image-size/large?v=v2&px=999 "Sni?mek obrazovky 2023-06-02 v?10.52.53.png")


Answers:
author: Darryl Lee
body: [@Kian Stack Mumo Systems](/t5/user/viewprofilepage/user-id/853673) is correct - there is a Suggestion you could vote for, but since it's remained open for almost 9 years, I'm not optimistic a vote would make a difference:

* [CONFCLOUD-34041 - Disabling the ability to view the "Page History" on a space](https://jira.atlassian.com/browse/CONFCLOUD-34041)

HUH. I just thought of an actual use case for [Confluence automation](https://support.atlassian.com/cloud-automation/docs/create-automation-rules-in-confluence/).

* If page status of a page in "Private Staging space" changes to "Ready for Publication".
* Copy page to "Public Documentation space". (Which will not include page history. Also, it will not include comments, which would also be useful, I think.)

For extra credit, it'd be interesting to see if we could check:

* If a page in "Ready for Publication" status has been edited after "publication":
  * Archive the old version of the published page
  * Copy new version of the page to the "public space"

The challenges would be:

* Getting the page history to see when status changed.
* Archiving a **different** page than the triggering page.

comments: author: Trev Angle
body: You can use Confluence automation's CQL condition to check when the page was last edited, and you can use the "related entities" branch to archive a specific page


author: Darryl Lee
body: Thanks [@Trev Angle](/t5/user/viewprofilepage/user-id/5027568). I guess what I ***really*** need is to see if Status was already "Ready for Publication" *prior* to the edit that triggers a rule. Is there CQL for that?

Actually I'm not even sure how CQL would let you check "when the page was last edited". Doesn't CQL only let you do something like:

```
lastmodified > 2023-05-01
```

What I need is a ***hypothetical*** Smart Value like this:

```
{{previousVersionofPage.status}}
```

So I could compare it against "Ready for Publication" and if it matches, then yeah, I guess if related branches can included COPIED pages. Does Confluence have a concept of links like that? I guess I will see!


author: Darryl Lee
body: OK, fun experiments! When the trigger is **Page status changed** it looks that {{content}} contains some very useful values:
> previousContentState={contentStateType=custom, id=833650689, color=#8777d9, name=Ready to publish},
>
> currentContentState={contentStateType=space, id=833617923, color=#57d9a3, name=Ready for review}}

But when the trigger is **Page edited** (without changes in status) *previousContentState* and *currentContentState* are NOT POPULATED.

So then, for my extra credit, this lets us find when a PRIVATE page that had been edited (but status has not changed), and archive the old PUBLIC copy of page and then copy the new version over:

![Screenshot 2023-06-02 at 5.11.52 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/261104iB4ECE82C393E9B4F/image-size/large?v=v2&px=999 "Screenshot 2023-06-02 at 5.11.52 PM.png")

Combine this with the other rule I described and huh, you now have a "publishing" solution.

++**ONE PROBLEM:**++

[@Trev Angle](/t5/user/viewprofilepage/user-id/5027568) can you please explain why Custom statuses are not showing up for the **Page Status changed** trigger? I DEFINITELY have scoped my rule for a single PRIVATE space which has the "Ready to publish" status, but it's not showing up:![Screenshot 2023-06-02 at 5.23.55 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/261105iD3B54894BE50DC21/image-size/large?v=v2&px=999 "Screenshot 2023-06-02 at 5.23.55 PM.png")![Untitled.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/261107i5F103DB0B22673B7/image-size/large?v=v2&px=999 "Untitled.jpg")

Is this a known issue?


author: Trev Angle
body: Hi [@Darryl Lee](/t5/user/viewprofilepage/user-id/1365322),

Unfortunately those extra fields you see on the smart value from the page status changed trigger were added by accident, and they will likely be gone soon. However, I think this is 100% a legitimate use case and I'll bring it up to the team!

As far as the status not showing up, that is expected. Custom statuses are individual, meaning that if you create a custom status, other people won't be able to set that status themselves. Only "suggested" statuses will show up in that picker. However! The good news is that you can change the suggested statuses. If you add a "Ready to publish" suggested status in your space's settings, then it should show up in the automation trigger.


author: Darryl Lee
body: Ugh, bummer that the hidden smart values I found are going to be going away. They are **totally useful,**so I appreciate you letting the team know.

And thanks for the education about statuses. They're new to me, so now I understand Custom (personal) Statuses vs Suggested Statuses. However, the [trigger documentation](https://support.atlassian.com/cloud-automation/docs/triggers-in-confluence-automation/#Page-status-changed) states:
> Content statuses are specific to each space. So, if you're in Global Automation, the trigger can't provide status selections until you set and save the rule's Scope (in rule details) to a specific space or spaces. Once the scope is saved, both Suggested and ++Custom++ statuses will surface as options

So... that might need an update.

I did a little more testing of my rules, and UGH, Page Title have to be unique even if the conflicting page is Archived? ANNOYING. Also, there is no **Rename Page**action, so... I have to rename it via a Web Request and API? Oooooy.


author: Darryl Lee
body: Welp, as often happens, I ended up going down a rabbit hole and decided I might as well write another article nobody asked for:

* [CMS with Confluence Automation?! Sure why not?](https://community.atlassian.com/t5/Automation-articles/CMS-with-Confluence-Automation-Sure-why-not/ba-p/2381891)


author: Kian Stack Mumo Systems
body: [@Dagmar Cervenkova](/t5/user/viewprofilepage/user-id/4799959), as far as I am aware if a user can see the page they can view the history.

Thanks,

Kian