Forge Macros: localId duplicated when copying?

Hi,

I’ve noticed that when you copy a Forge macro onto the same page in Confluence, that both macros will have the same context.localId.

How can I uniquely identify the macro that the user is interacting with? Is there another -truly- unique identifier I can use?

1 Like

To clarify, I can see that there’s a unique localId of the extension, even when you copy/paste it, but fetching the localId from the context gives the localId of the parameters.

So in the below example, I would like to get the localId 46940504-4d06-4012-b2e6-55a660673b51, but context.localId returns 8e1ff3f0-3b65-4091-b07c-71da501a4497, which is the same as in the pasted macro

<ac:adf-extension>
  <ac:adf-node type="extension">
    <ac:adf-attribute key="extension-type">com.atlassian.ecosystem</ac:adf-attribute>
    <ac:adf-attribute key="extension-key">
        ...
    </ac:adf-attribute>
    <ac:adf-attribute key="parameters">
        <ac:adf-parameter key="guest-params">
            ...
        </ac:adf-parameter>
        <ac:adf-parameter key="local-id">8e1ff3f0-3b65-4091-b07c-71da501a4497</ac:adf-parameter>
        <ac:adf-parameter key="extension-id">
            ...
        </ac:adf-parameter>
        <ac:adf-parameter key="extension-title">My Macro</ac:adf-parameter>
    </ac:adf-attribute>
    <ac:adf-attribute key="text">My Macro</ac:adf-attribute>
    <ac:adf-attribute key="layout">default</ac:adf-attribute>
    <ac:adf-attribute key="local-id">46940504-4d06-4012-b2e6-55a660673b51</ac:adf-attribute>
</ac:adf-node>
<ac:adf-fallback>
...
</ac:adf-fallback>
</ac:adf-extension>
1 Like