How to get Issue Id or Issuekey of a current Issues using Forge Custom UI

Am trying to get Issue Id or Issuekey of a current Issues using Forge Custom UI but it throws errors issueKey undefined

import Resolver from '@forge/resolver';
import api, { route } from "@forge/api";

import { useProductContext } from '@forge/ui';

const resolver = new Resolver();

resolver.define('issueFunction1', async (req) => {
    const {issueKey} = req.context.extensionContext;
    return issueKey;


});



resolver.define('issueFunction2', async (req) => {
    const { platformContext: { issueKey } } = useProductContext();
 return issueKey;

});
1 Like

The useProductContext hook is only for UI Kit apps.

Custom UI apps can get context information using getContext on the Custom UI Bridge.

Hi @AdamMoore !

I’m having trouble finding an example of how to get the issue key via the getContext method. Could you maybe share how to retreive the issueKey using getContext?

Thanks!