Hi all,
I’m playing around with Forge and attempting to create a trigger-based app that posts issue events to a third-party service. I have it working but I’m running into a weird issue that appears to be unique to the forge development environment.
Here’s the function I’m running when an issue is created:
import api from "@forge/api";
// stuff
async function handleIssueCreated(event) {
const timestamp = event.issue.fields.updated;
console.log('Posting ISSUE_CREATED event');
const res = await api.fetch(PUSH_ENDPOINT, {
method,
headers,
body: {
event: "ISSUE_CREATED",
timestamp,
...event
},
});
console.log('hello');
}
The “hello” console.log
statement never executes when running forge tunnel. The API call succeeds and I see the event being posted to my service, but it appears as if anything after api.fetch
is not run.
There’s a non-zero chance I’m missing something blindingly obvious here. Any ideas?