Duplicate restricted page content and enable visibility in another page
Asked by Patrick Neumann:

So far I found no workaround for the Confluence permission scheme, let's describe the use case.

1. Content in a restricted space / page is created.

2. This content is required for colleagues which do not have access to the original content on the restricted space / page.

3. To avoid manual duplication and information sharing, I'd like to create a page in another space which duplicates the content of the original page automatically. With this I can avoid to adjust restrictions for the original page.

-\> All Macros (Excerpt / Page Include) and Add-Ons I've tried so far are limited due to the permission scheme. Is there any solution for the above?


Answers:
author: Trev Angle
body: Hi [@Patrick Neumann](/t5/user/viewprofilepage/user-id/4967798), Trevor here from the Confluence automation team. Depending on the exact details of your use case, I believe you can use Confluence automation to achieve this. [@Alex Koxaras _Relational_](/t5/user/viewprofilepage/user-id/4150197) suggested using an automation rule with a 'Send web request' action, but that might not be necessary. There is an automation action named 'Copy page' that may fit your use case. Here is an example of a working rule that copies a page to another space and removes restrictions:

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

However, I understand people may want to publish the page before copying it. In that case, one solution might be to use a special label that marks the page as being ready for copying. Here is an example of a working rule that copies a page to another space without restrictions when a certain label gets added (the configuration of the 'Copy page' action did not change):

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

Another alternative is to use page statuses instead of page labels. In this case you would use the 'Page status changed' trigger instead of the 'Page or blog labeled' trigger.

Now, if you require the public copy of the page to be updated every single time the private copy is updated, then these strategies will not work. At this time you cannot use automation directly to update the body of a page. If you need to continuously update the body of the public copy of the page, I think your only option with automation is to do as [@Alex Koxaras _Relational_](/t5/user/viewprofilepage/user-id/4150197) suggested, and use the 'Send web request' action, perhaps together with the 'Page edited' trigger.


author: Alex Koxaras _Relational_
body: Hi [@Patrick Neumann](/t5/user/viewprofilepage/user-id/4967798)

Your requirement is ++just to copy a "restricted" page++ to a new page of another space, or you want to include any update of the restricted page to the new page on the other space?

comments: author: Patrick Neumann
body: Hi [@Alex Koxaras _Relational_](/t5/user/viewprofilepage/user-id/4150197) ,

thanks for your answer. The requirement is to include the updates aswell.

BR Patrick


author: Alex Koxaras _Relational_
body: The only way I can think of, is to user Automation for confluence and REST API. Your rule should look like the following:

![confluence send web request.png](https://community.atlassian.com/t5/image/serverpage/image-id/249478i6C4BB34950AD5FA6/image-size/large?v=v2&px=999 "confluence send web request.png")

and inside the web request you should place the [update page endpoint](https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-id-put):

```
PUT /wiki/api/v2/pages/{id}
```

The page ID of the web request should be the page id of the target page.


author: Patrick Neumann
body: Hi [@Alex Koxaras _Relational_](/t5/user/viewprofilepage/user-id/4150197) ,

once more thanks for your reply.  
However I was not able yet to get the Web Request running.  
Do you have any hint for me?

Best Regards  
Patrick

comments: author: Alex Koxaras _Relational_
body: [@Patrick Neumann](/t5/user/viewprofilepage/user-id/4967798) hi!

What are the results you are getting? What does the audit log say?


author: Patrick Neumann
body: Hi [@Alex Koxaras _Relational_](/t5/user/viewprofilepage/user-id/4150197) ,

below you can see the rule I've now defined.  
I have to admit that I am not familiar with Web Request. So I am not sure about if the rule is complete.

![RuleDetails.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/254178i349AE4F1BC7B963F/image-size/large?v=v2&px=999 "RuleDetails.JPG")

Empty Target Page (ID highlighted yellow):

![TargetPage.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/254179iFBE4B8A9D4453B7B/image-size/large?v=v2&px=999 "TargetPage.JPG")

Audit Log:

![AuditLog.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/254180i9D7C153E857E134B/image-size/large?v=v2&px=999 "AuditLog.JPG")

BR Patrick


author: Patrick Neumann
body: Hi [@Trev Angle](/t5/user/viewprofilepage/user-id/5027568) ,

I am now using your approach by copying pages.  
I use Date \& Time in page title to ensure automation generate pages with different titles and does not throw any issues.  
However I am currently investigating to further improve the rule by deleting outdated pages automatically.

![Copy_Page.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/252212iD0E481818FCA9ACC/image-size/large?v=v2&px=999 "Copy_Page.JPG")

Hi [@Alex Koxaras _Relational_](/t5/user/viewprofilepage/user-id/4150197) ,

I am further investigating your solution, currently it throws below error which I was not able to solve yet.

![Web_Request_2.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/252217iF892D230D4278E1F/image-size/large?v=v2&px=999 "Web_Request_2.JPG")![Web_Request.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/252216iFB76E113D384E01A/image-size/large?v=v2&px=999 "Web_Request.JPG")

Thanks again for your help!  
Patrick

comments: author: Trev Angle
body: Wow, that's a good idea! Maybe we can make an official template that does something like that.


author: Patrick Neumann
body: Hi all,

really appreciate the feedback - thanks!  
I'll give it a try with Confluence Automation and once done will let you know about my result.

Best Regards  
Patrick


Tags: cloud

confluence-cloud