Forums

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

How do we force a page containing a macro to automatically create a new version of the page on save?

Yagnesh Bhat
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.
September 1, 2021

We have a macro which on save adds a new parameter value on the fly in the page's storage format. While that is working, the page itself is not creating a new version or draft of it eventhough we clearly see the storage format has changed. We tried using

 

pageManager.saveContentEntity(page, new DefaultSaveContext.Builder().build());

 

where 'page' is the concerned page object - it IS updating the macro parameter and page storage format correctly but not the page version.

 

Please advise if any other alternatives. 

1 answer

1 accepted

0 votes
Answer accepted
Yagnesh Bhat
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.
September 2, 2021

Found this solution feasible for my needs, hence closing this ticket out with the solution, for everyone's reference:

 

pageManager.<Page>saveNewVersion(page, page1 -> page1.setBodyContent(content), new DefaultSaveContext.Builder().build());

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events