Fixing Connect AP.confluence.getMacroBody for dynamic content macro with plain-text body type

What is changing?
Within the Fabric Editor in preview mode, a dynamic content macro with the plain-text body type will be updated with a new body value.
Related API: Confluence

Why is it changing?
It was a bug. AP.confluence. saveMacro was saving body value but in preview mode macro was not getting updated with the new macro body.

What do I need to do?
Developers can now use AP.confluence.getMacroBody in their app to get updated body values. Make sure the app is plain-text body type.

By when do I need to do it?
The bug fix is available for members of the developer first release cohort

5 Likes

Hi @TapanParikh Thank you for the update. This is really fantastic news.
We have been waiting for a fix since 2019. As they say, better late than never.

I did a quick check and AP.confluence.getMacroBody function indeed seems to work (i.e it returns the expected latest version). Do you have any timeline when it will be released to all customers?

Glad to hear that fix worked for you.

We plan to roll out to all customers on 2021-11-08T08:00:00Z

@TapanParikh Great news. Has this fix been applied to both getMacroBody() and getMacroData() ?

Thanks for reaching out to us.
Current fix is for getMacroBody() for plain-text body type.
Related to getMacroData() is fixed as part of [CONFCLOUD-70639] Calling getMacroData returns stale results - Create and track feature requests for Atlassian products..
Let me know if still have any questions.

1 Like

I find this a confusing response…

You say that the getMacroData() is fixed as part of [CONFCLOUD-70639] Calling getMacroData returns stale results - Create and track feature requests for Atlassian products., but that ticket actually mentions in the last comment (by you) that it was fixed as part of [CONFCLOUD-69962] Connect JS AP.getMacroBody does not work in Preview Mode - Create and track feature requests for Atlassian products., which I assume is the ticket you are discussion in the OP?

Sorry for the confusion.

The first iteration of the fix for [CONFCLOUD-69962] Connect JS AP.getMacroBody does not work in Preview Mode - Create and track feature requests for Atlassian products. actually fixed the getMacroData() and closed ticket [CONFCLOUD-70639] Calling getMacroData returns stale results - Create and track feature requests for Atlassian products. with comments. The second(current topic) iteration of fix for CONFCLOUD-69962 will fix the getMacroBody() for plain-text body type.

To clear the confusion getMacroData() is fixed and getMacroBody() for plain-text body type is fixed.

Hope that clears your confusion.

1 Like

Have you tried this with Macro Editor?
Unless I need to wait for “the release”… currently it does not seem to work

May be related to the bug where calling to

AP.confluence.saveMacro(macroParams, macroBody); 

does not save macro body

Thanks for reaching out to us.
Yes, I tried with dynamic macro with plain-text body type with macro editor.
Currently, we have rolled to developer first release cohort. Planning to roll out in prod from Oct 25th in incrementing phases.