How to retrieve "projectKey" from app context with Forge?

Hi all,

i am wondering how to retrieve the key of the current Jira project my Forge app is working with?!

Forge provides the useProductContext() hook, however, this hook does not provide the projectKey or any related data.

Please help.

Thanks
Valentin

projectKey is only available in the ProductContext https://developer.atlassian.com/platform/forge/ui-kit-hooks-reference/#useproductcontext for those modules https://developer.atlassian.com/platform/forge/manifest-reference/modules/index-jira/ related to a project e.g. Jira Project Page, see section “Extension Data” https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-project-page/#extension-data there you see projectId mentioned, but not Jira Global Page or Jira (Global) Admin Page, which don’t have projectId in context.

2 Likes

Thanks @Holger this works. I am wondering why I do not found this info by myself…
Anyway, thanks :slight_smile: