Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Button user macro executes on page display not when button clicked

Rich Scire
Contributor
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
atlassian, likes for trees, atlassian community, social impact, tree planting campaign, community kudos, atlassian giving, environmental impact, sustainability, likes for good, atlassian social responsibility, community challenge

Make every click count—help us plant 50,000 trees! 🌳

Want to make your everyday Community actions directly contribute to reforestation? The Atlassian Community can achieve this goal by liking a post, attending an ACE, sending your peers kudos, and so much more!

Help us plant more trees
AUG Leaders

Atlassian Community Events