After reading numerous threads and issues on the topic I need to confirm that I’m not missing something obvious
The use case is very straight forward:
- User edits a confluence page
- The user adds macro “/my-custom-ui-forge-macro”
- Custom UI editor is displayed to the user
- The user enters text, creates a diagram or something else that requires a complex custom UI
- The user saves the change
- The macro is rendered/displayed based on the data entered by the user
So, the data entered by the user needs to be saved and be read somehow in the context of the macro instance in the page.
On Connect this was:
AP.confluence.saveMacro(
...,
userEnteredData
);
and
AP.confluence.getMacroBody(function (body) {
...
}
Now, what is the intended way to do this on forge? I’m asking for the intended way here since
-
Storing text in Macro body wasn’t intended since it is not supported? [FRGE-216] - Ecosystem Jira
-
Storing it using Storage API using localId as key wasn’t intended since the localId isn’t unique and marked as minor? [FRGE-1269] - Ecosystem Jira
Note1: There seems to be a migration path for moving from storing the data in the macro body so there is some there must be some thought on where we should store it after reading it out: Support for saved macro modules when migrating from Connect to Forge macro - EAP - #5 by HanjooSong
Note2: The REST API actually has Content macro body but it only offers GET, no PUT so it is also not the intended approach? https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content---macro-body/#api-group-content---macro-body