Question related to Confluence automation
Asked by javed.faruquee:

Hi,

I was looking for a way to automate archive PAGE or SPACE in confluence based on flag or comment or label which user can choose indicating that the PAGE is no longer actively used or SPACE for the Project is not actively used coz project is completed and thus they should be archived making them READ ONLY with DELETE restrictions for such SPACE or PAGE.

Regards

Javed


Answers:
author: Aron Gombas _Midori_
body: [@javed.faruquee](/t5/user/viewprofilepage/user-id/5127012) With the Better Content Archiving app, you can configure an automation with this CQL:

```
label = "not-used"
```

...and with the action "archive". You can execute it according to your custom schedule, preferably out of your regular working hours. When it is executed, the CQL query will be ran and the resulted pages will be bulk-archived.

![configure-automation-scheme-cloud.png](https://community.atlassian.com/t5/image/serverpage/image-id/270984iEA2CFDD237ED9234/image-size/large?v=v2&px=999 "configure-automation-scheme-cloud.png")

Learn more about the [automations](https://midori-global.com/products/better-content-archiving-for-confluence/cloud/documentation/configure/automation-schemes#introduction).

---

Also, note that app also allows you defining a [custom page status](http://"Not%20used") called "Not used" which will be displayed on the top of pages that have the "not-used" label. Plus, you can [create a report](https://midori-global.com/products/better-content-archiving-for-confluence/cloud/documentation/content-status/content-status-overview#introduction) about the unused pages, [search for them](https://midori-global.com/products/better-content-archiving-for-confluence/cloud/documentation/content-status/search), etc. The app is a full-blown lifecycle management solution for Confluence content.


author: Trev Angle
body: Hi [@javed.faruquee](/t5/user/viewprofilepage/user-id/5127012) this is definitely possible for pages! Here is an example of an automation rule that archives pages when they have the 'archive' label added:

![Screenshot 2023-04-03 at 11.26.34 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/249536i00CB553FCD5441D6/image-size/large?v=v2&px=999 "Screenshot 2023-04-03 at 11.26.34 AM.png")

For spaces, there is currently no direct way to archive a space through automation. However, you may be able to use the 'Send web request' action to call the Confluence REST API through an automation rule: <https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-space/#api-wiki-rest-api-space-spacekey-put>


author: Bill Sheboy
body: Hi [@javed.faruquee](/t5/user/viewprofilepage/user-id/5127012) -- Welcome to the Atlassian Community!

*First thing: I am not currently using Confluence Automation, and I am basing my answer on what I know of Jira Cloud Automation and the documentation. With that disclaimer out of the way...*

Confluence Automation is supported with the Premium or Enterprise license levels. Do you have one of those?

There is a trigger for adding a label to a page, conditions for using CQL to test label values, and an action to archive a page. So it appears this should be possible.

Please look here to get started creating your rule: <https://support.atlassian.com/cloud-automation/docs/confluence-cloud-automation/>

Kind regards,  
Bill