Get macro params from new editor preview

Hey guys,

I found an issue regarding macro preview in new editor experience.
We open our macro editor a confluence page, and hit submit button. When clicking the submit, we are storing a few parameters as macro params.
After hitting the submit button in the macro editor, the editor preview renders and we try to get macro data using the javascript API (AP.confluence.getMacroData). However, the response is an empty object. Macro documentation states that only after the first macro publish the addon is able to perform any operation with the macro id, which is not the case. But I was expecting getting macro data from javascript API to work. Besides, if I edit the same unpublished macro and get the macro data using the same javascript api, I get all the params I stored.
What’s weird is that if I pass macro params as query params in the macro preview url, they are returned. However, this is not useful because parameters could grow in size (it’s an array, actually), which could case the addon to break due to a too large url.
So, what’s the solution?

Why running AP.confluence.getMacroData in a macro preview before its first publish does not return anything, but if I pass the macro params in the url they are there?

Thanks!

1 Like

Hi @lfcgomes,

I agree that the behaviour/API you describe is not ideal. I created CONFCLOUD-62377 to address this.

Regards,
Dugald

@dmorrow - that ticket is now almost 2 years old. Is there any update on when this might be available?

Hi @ademoss, I don’t believe any progress has been made. The team looked into it when I originally created the issue, but I understand it is challenging to solve. I’ll bring it up with the team again.

@dmorrow - I appreciate the quick response.
I am curious, does the fact that it is challenging to solve contribute to the fact that it takes 2 years to implement? What can I, as a vendor, do to help this along? (besides voting on a ticket, which appears to be entirely pointless).

1 Like

Hi @ademoss,

I am sure the team is focussed on maximizing the amount of value they deliver over time. Simpler fixes often get resolved more quickly because of this. However, since raising this issue, the team has spent a significant amount of energy on security, privacy and reliability which takes precedence over regular bug fixes and enhancements.

In terms of “helping this along”, we do factor in the number of votes each issue has. You are also welcome to challenge the issue type and severity. For example, I raised this as a “Suggestion”, but I can see an argument that the API is so bad it could be considered as a defect.

Regards,
Dugald

@dmorrow Thanks for the prompt response.
Could you please ping this thread when you have more information about it? Like plans for having it solved, or if we really consider a workaround to address this problem.

Cheers

1 Like

Why the related ticket is called “Make AP.confluence.getMacroData() available in view mode”, when the actual problem is with a “preview” mode in new Confluence editor!?

I suspect they relate to the same underlying cause, but I’ll add a comment to the ticket to ensure the preview mode in the new editor is factored in.

Hi @lfcgomes, rather than relying on me pinging you when the problem is fixed, it would be better for you to add yourself as a watcher to the issue.