Storing user entered data for Macro with Custom UI editor using forge

After reading numerous threads and issues on the topic I need to confirm that I’m not missing something obvious :thinking:

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

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

2 Likes

Hi @StaffanDevelop,

Welcome to the Atlassian Developer Community and thanks for this insightful analysis and query.

I’ve asked the Confluence Ecosystem team to investigate and respond.

Regards,
Dugald

2 Likes

Hi @StaffanDevelop ,

I’m circling back to say that I’ve brought this up with the Forge team and they acknowledge the gap that you’ve identified and will prioritise solving this.

Regards,
Dugald

1 Like

Hi, thank you for bringing it to the team! That’s excellent news, looking forward to being unblocked :slight_smile:

/Staffan

1 Like