I noticed that there is a difference in the context if I use it in different Forge modules. I am working with customContent where I need the appId and the environmentId to build the content type key (as described in the custom content documentation).
The provided solution to extract the appId noted in the question Is there a way to get the Installation Id and App Id programmatically in Forge? works fine on a general page, BUT it seems the localId differs in structure and value for macro modules. The envronmentId is missing completely…
I work with Custom UI, but the same ist true for the macro config (which is kind of UI Kit).
Any Ideas what’s wrong here and how to retrieve the appId and envronmentId inside a macro?
This a big blocker for us, as can’t create or retrieve our custom content inside a macro.
See the two contexts
Macro
context: {
localId: '12345678-1234-1234-1234-123456789012', <<< NOT MY APP ID
cloudId: 'foo-bar',
moduleKey: 'list-macro',
siteUrl: 'https://foobar.atlassian.net',
extension: {
type: 'macro',
content: [Object],
space: [Object],
isEditing: false,
config: [Object]
},
...
}
GeneralPage
context: {
cloudId: 'foo-bar',
localId: 'ari-cloud-ecosystem--extension-12345678-1234-1234-1234-123456789012-12345678-1234-1234-1234-123456789012-static-overview',
environmentId: 'foo-bar',
environmentType: 'DEVELOPMENT',
moduleKey: 'overview',
siteUrl: 'https://foobar.atlassian.net',
extension: {
type: 'confluence:globalPage'
},
...
}