Macro copy page with dialog - how to

Jean-Michel Rottiers April 2, 2020

I'd like to create a user macro allowing to mimic the copy page behavior in Confluence. This is needed to allow controlled page copies performed by team members. For internal reasons the templates are difficult to use for us. 

 

Macro should have different parameters

- page to copy

- page Title

- target space

- parent page

Display the link in for of a button (using button class 

Is this achievable? I'm facing issue in the URL construction

Thank you

1 answer

0 votes
Dominic Lagger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 7, 2020

Hi @Jean-Michel Rottiers 

The macro itself with these parameters shouln't be a problem. I see a challenge in the copy process. As far as I know, there is no copy function in velocity. So you would have to do it with REST API. And also there is no copy function. That means, you have to get the content and create a new page. 

The other thing is, you have to do it with velocity and Javascript in the user macro browser (Another challenge). A good example for creating a new page is here: Confluence REST API example. (In the middle is the section "Create a new page (jQuery)"). Be careful with the login credentials. 

Another negativ impact would be: The user clicks the button and nothing happens... because the new page was created in the background. 

It might be, there is an easier way to do this, but I can't remember any... 

My Questions:

Did you try something already, Did you have any success? You wrote, that you have a problem with the URL construction. What do you mean with this? 

Hope this helps

Regards, Dominic

Jean-Michel Rottiers April 9, 2020

Thank you for your reply I was playing with different parameters one user macro but I was not able to properly construct the URL with the parameters.
I will stick to the native feature and instruct my users to use it following a standardized procedure.

 

Thank you

Like Dominic Lagger likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events