Dear community,
I’ve tried multiple ways to access JSM Assets from a Web Trigger (and Scheduled Jobs modules) using requestJira
, but it’s not working as expected. On the other hand, direct access via fetch
works fine.
Here’s what I’ve tried (and it is not working):
const response = await api.asUser().requestJira(`https://api.atlassian.com/jsm/assets/workspace/WORKSPACE_ID/v1/object/36`, {
headers: {
'Accept': 'application/json',
'Authorization': 'Basic TOKEN'
},
});
As well as:
- The same with “api.asApp()”
- The same with "api.asApp().requestJira(route
/jsm/assets/workspace/WORKSPACE_ID/v1/object/36
); - The same with " - read:cmdb-object:jira" permission and a few others
The only method that works reliably is using fetch
:
const response = await fetch('https://api.atlassian.com/jsm/assets/workspace/WORKSPACE_ID/v1/object/36',
{
headers: {
'Accept': 'application/json',
'Authorization': 'Basic TOKEN'
},
}
);
Unfortunately, I can’t rely on fetch
because Forge imposes a limit of 100 requests, and any additional requests are skipped. requestJira
doesn’t have this limitation, but I can’t seem to get it to work.
Does anyone have advice on how to resolve this? Any help would be greatly appreciated!