Error retrieving issues: 'Issue does not exist or you do not have permission to see it

Hello Atlassian Community,

I am currently trying to retrieve issues using this function

 const fetchIssues = async (issueIdOrKey) => {
    const response = await api.asUser().requestJira(route`/rest/api/3/issue/${issueIdOrKey}`, {
      headers: {
        'Accept': 'application/json'
      }
    });
    
    console.log(`Response: ${response.status} ${response.statusText}`);
    console.log(await response.json());
   }
   resolver.define('Get issues', async ({context}) => {
    const issues = await fetchIssues();
    console.log(issues);

  });

However, when I call this function in my front end

 useEffect(() => {
        async function fetchIssues(){
            const issues = await invoke('Get issues');
            console.log(JSON.stringify(issues));
        }
        fetchIssues();
    },[]);

I am getting the following error:

{
errorMessages: [ 'Issue does not exist or you do not have permission to see it.' ],
errors: {}
}

I have already specified the necessary permissions in my manifest file, but the error persists. Do any of you have any ideas on how to resolve this issue? Thank you in advance for your help.

Hi @SarraMEHREZ,

This error is not caused by a lack of permission in the manifest file. This error is returned by the Get issue REST API when the user does not have the necessary permissions to view the issue, or in some cases, the issue key or ID is incorrect (or does not exist).

Upon looking at your code, what issue ID or key are you passing to fetchIssues?

Cheers,
Ian