Button user macro executes on page display not when button clicked

Rich Scire September 23, 2019

I have a user macro that moved a page to another parent:

The macro is triggered when the page is displayed not when the button is pushed. If I manually move a page to a different parent, it is moved right back without clicking the button.

Why is this happening? How can I get it to work as intended?

 

## @noparams

#set ($pageManager = $action.getPageManager())

#set ($page = $content.getEntity())
#set ($destinationPage = $pageManager.getPage(309990621))

<button class="aui-button" onclick="{$pageManager.movePageAsChild($page, $destinationPage)}">Activate Project</button>

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events