@forge/bridge events

Hello folks !

I’ve just created an app from scratch with forge create and selected Custom UI as template.

In the initial code supplied, I can see there a subscription for an event :

        const subscribeForIssueChangedEvent = () =>
            events.on('JIRA_ISSUE_CHANGED', () => {
                fetchLabels().then((labels) => {
                    setLabels(labels);
                }).catch((error) => {
                    console.log("Failed to fetch labels : ", error)
                });
            });

Who does the emit of the JIRA_ISSUE_CHANGED ?
Are there any default events triggered by forge that we can use in our apps ?

Looked through the code supplied after the app creation, could not find any reference like :

events.emit("JIRA_ISSUE_CHANGED")

Is this magic ? I don’t think so :slight_smile:

Wondering who is sending this event and if so, are there any documentation to check available default events ?

Thanks a lot !

1 Like

Yes, certain Jira modules have events that tell you when an issue has been updated (e.g. issue panel). Your app can listen to a frontend event and refresh the UI to react to a given change

2 Likes