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?

2 Likes

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>
2 Likes

Hi,

I’ve been looking into a similar report and went ahead and raised [FRGE-1269] - Ecosystem Jira so that there is a central place to track this issue.

(FYI: me raising this ticket doesn’t mean that it will be addressed, I just wanted the problem to be documented).

Caterina

1 Like