Hello,
In my sandbox I am successfully able to submit this mapping schema through tunnel and without tunneling, this returns a “204 No Content” , but once I try this in production it gives me a 403 Forbidden error.
I’m using requestJira, so no bearer token or api token per se. Prod has the same scope permissions as in sandbox, so I don’t see how it can be permissions, but I might be wrong and extra permissions might be needed in prod. I’m actually not even importing data yet, I’m just creating this type of app: https://developer.atlassian.com/platform/forge/assets-import-app/, when I hit “Configure App”, that’s when the schema.js file should be submitted to “{{/jsm/assets/workspace/${workspaceId}/v1/importsource/${importId}/mapping”}}, but that’s where I see the error. Any ideas why? Thanks.
1 resolver.define('submitConfig', async (req) => {
2 let workspaceId = req.context.extension.workspaceId
3 let importId = req.context.extension.importId
4 let data = JSON.stringify(schema)
5 const response = await api.asApp().requestJira(route`/jsm/assets/workspace/${workspaceId}/v1/importsource/${importId}/mapping`,
6 {
7 method: "PATCH",
8 headers: {
9 'Content-Type': 'application/json'
10 },
11 body: data
12 }
13 );
14 if (!response.ok) {
15 console.log("Unable to update mapping: " + JSON.stringify(response));
16 }
17 console.log(`Create Mapping Response - ${response.status} ${response.statusText}`);
18 return response.status
19})