Missing permissions when using .asApp()

Hey Jarod,
I was able to create the issue on my site, here’s my code (i hard coded the project and issue types … but you get the idea).

The permission used when you send through a request on your behalf versus on the apps behalf are different, so that in itself would indicate a possible permission issue.

I’m wondering what your project permissions are set to for ‘create issue’ for the project you’re creating the issue in? (My Create Issues permissions are granted for: Project Role (atlassian-addons-project-access), Application access (Any logged in user))

import api from "@forge/api";

export const run = async () => {
    var bodyData = `{
  "update": {},
  "fields": {
        "summary": "Hello World",
        "issuetype": {
            "id": "10001"
        },
        "project": {
            "key": "CATS"
        },
        "description": {
            "type": "doc",
            "version": 1,
            "content": [
                {
                "type": "paragraph",
                "content": [
                    {
                    "text": "Hello World.",
                    "type": "text"
                    }
                ]
                }
            ]
        }
    }
}`;

    const response = await api.asApp().requestJira('/rest/api/3/issue', {
        method: 'POST',
        headers: {
            'Accept': 'application/json',
            'Content-Type': 'application/json'
        },
        body: bodyData
    });

    console.log(`Response: ${response.status} ${response.statusText}`);
    console.log(await response.json());
};
2 Likes