Is it possible based on environment choose what data to render. For example in tunnel mode I want to show additional debug data, but don’t want to remove it every time before publication to production.
Also want to disable triggers that under development right now.
I already tried to read process.env, useConfig, useProductContext but no luck.
Hi @MaxMykhailenko - in the useProductContext hook you should receive a value for environmentId - this environment ID refers to the deployment environment of your app (dev, staging and production) and will be unique and immutable for each environment your app is deployed to.
I’m not an expert on the Jira extensibility modules in Forge… but since recalculateEpic is a custom field value function, it might not receive the full invocation context. Additionally, since it’s not a UI function, you can’t use the useProductContext UI Kit hook - you would instead receive the context object as a function parameter if it was supported - similar to how the context is passed in for event triggers -
Since the environment ID will never change for the app (unless you regenerate a new app ID), instead of trying to receive it as input here, you could instead capture the environment ID when the app is first installed using a life cycle event and persist it for later reference: https://developer.atlassian.com/platform/forge/events-reference/life-cycle/#installation
Or, once you have captured this info from testing out the lifecycle event, you could hard-code the ID in your app since it won’t change.