INFO 10:06:16.588 0727b00aef3dc0b3 {
errorMessages: [
'You are not authorized to perform this act
ion. Administrator privileges are required.'
],
errors: {}
}
I have a Forge Custom UI app and I’m calling this endpoint from a web-trigger.
Web-triggers currently only support asApp() calls - not asUser(). This is due to the fact that we can’t pass a user context to webtriggers, as in theory they could be triggered from anywhere on the internet.
Let me explain the scenario: I have a set of calls that I need to perform when the user installs the app. Since there’s no dedicated module for that, I want to create a scheduled web trigger that will do that.
The idea is to perform this set of operations and save a flag in the app’s storage. Then, whenever this scheduled web triggered is called, it will first check the flag. If it’s true, it will not perform these operations.
Now, I have several issues with that:
The scheduled trigger is not called when the app is installed. It will start on it’s next interval and not when the user install the app.
I can’t use asApp/asUser inside the scheduled trigger. I also tried to use requestJira from @forge/bridge, but it doesn’t work as well.
Hi
Apologies for the late response, I wasn’t notified of the replies here.
The scheduled trigger is not called when the app is installed. It will start on it’s next interval and not when the user install the app.
I believe this is expected behaviour. I don’t believe we support directly performing an operation on the app being installed - the scheduled trigger is fired on the specified interval period.
I can’t use asApp / asUser inside the scheduled trigger. I also tried to use requestJira from @forge/bridge , but it doesn’t work as well.
asUser is not available in scheduled triggers. @forge/bridge is only available to Custom UI apps (i.e. running on the front-end). asApp() would be your best bet here, and my previous comment around permissions still applies