How to identify macros in Forge?

Hi,

I would like to store separate data in each macros. I’m using Storage API, so I need an unique macro key (like macros id) to get the required data. Is there any unique macros indentifier and how can I access it?

Thanks!

P.S.: I’m going to use custom UI.

Hi @veloti!

The localId property in the context argument passed to your Custom UI resolver is a reference to the instance of the macro that the resolver was invoked for.

cheers,
Tim

1 Like

Hi @tpettersen ,

the localId property in the context argument is unfortunatly not unique as it is duplicated if the macro gets copied by a user.

For example, I added a macro to a page and then copied it and added it a second time. As you can see in the atlas_doc_format below, the bold localId’s in the parameter-context are the same. Those get returned by the resolver.

However, the localId at the end of each macro is still unique. I assume that those are used by Atlassian internally. Unfortunatly those are not accessible for us Forge developers.

Another example is here: Forge Macros: localid duplicated when copying?

Could the first localId be made unique or the second one be made accessible? It is a major blocker for us.

Also, I have no clue whether or not you are the correct person to talk to, but I have no idea who else I should @mention. Could you forward this subject to the correct people?

Thanks!

{“type”:“doc”,“content”:[{“type”:“paragraph”},{“type”:“extension”,“attrs”:{“layout”:“default”,“extensionType”:“com.atlassian.ecosystem”,“extensionKey”:“6cafc343-0202-4853-b540-fa645ad49db9/646e12b5-e95a-4256-bdc2-a517167b99ea/static/xmlauslesen-front-end”,“text”:“xmlAuslesen (Development)”,“parameters”:{“guestParams”:{“uuid”:“238dba90-28ac-4bd7-9ee5-f888dbfa4491?”,“test1”:“not very creativ”},“localId”:“2f365162-5b1d-430a-a02c-a981438444f2”,“extensionId”:“ari:cloud:ecosystem::extension/6cafc343-0202-4853-b540-fa645ad49db9/646e12b5-e95a-4256-bdc2-a517167b99ea/static/xmlauslesen-front-end”,“extensionTitle”:“xmlAuslesen (Development)”},“localId”:“39236ab3-7750-4ac3-9f6d-8f9478af58a9”}},{“type”:“extension”,“attrs”:{“layout”:“default”,“extensionType”:“com.atlassian.ecosystem”,“extensionKey”:“6cafc343-0202-4853-b540-fa645ad49db9/646e12b5-e95a-4256-bdc2-a517167b99ea/static/xmlauslesen-front-end”,“text”:“xmlAuslesen (Development)”,“parameters”:{“guestParams”:{“uuid”:“238dba90-28ac-4bd7-9ee5-f888dbfa4491”,“test1”:“42?”},“localId”:“2f365162-5b1d-430a-a02c-a981438444f2”,“extensionId”:“ari:cloud:ecosystem::extension/6cafc343-0202-4853-b540-fa645ad49db9/646e12b5-e95a-4256-bdc2-a517167b99ea/static/xmlauslesen-front-end”,“extensionTitle”:“xmlAuslesen (Development)”},“localId”:“748a5c08-8246-4332-8049-fb033f88831e”}}],“version”:1}

3 Likes

Any updates on this topic?

1 Like

Hi all,

I’m not bringing any news regarding the fix of this problem but while answering another topic here in community, I saw that this problem was still current so went ahead and raised a bug report:

While this doesn’t mean that it will be addressed right away, there is a central place for tracking the problem, providing any additional feedback (if needed) and check for progress.

Thanks,
Caterina

1 Like

Hi @ccurti,

I just commented the ticket mentioned above - but post it here as well.
Hope that Atlassian will fix this. IMHO: it should not be much effort.

I’m wondering why this problem has existed for so long and is prioritized as “minor”, even though it has a significant impact.
I save configuration data and editing data in a Confluence macro. If a page with a macro is copied and the macro is edited on the new page, the previous data is overwritten! This is a disaster for the users!

A possible workaround for copying the macro to a new page:
=> To make the key more unique: use pageId as a suffix to the localId.

What do you think?

Dear Community experts,
please share your opinion on this topic.
Have you found a workaround?

Thanks!
Franz