Event when confluence page is updated

Looking at Refresh jira:issueContext when users changes workflow - #2 by dmorrow, there is a way to subscribe to events in Jira to be notified when the Jira issue is updated.

import {events} from "@forge/bridge";
...
useEffect(() => {
  events.on('JIRA_ISSUE_CHANGED', () => {
      someFunction();
  });
}, []);

Question: is there a similar event when a Confluence page is updated ?
Bonus question: Where is the list of events we can subscribe to ?

1 Like

I believe you’re looking for this: https://developer.atlassian.com/platform/forge/events-reference/confluence/

Specifically, the avi:confluence:updated:page event.

1 Like

Thanks @rcsr but that is not what I’m referring to.
I was talking about the Forge frontend events, not the backend events we can subscribe to.

The event JIRA_ISSUE_CHANGED is emitted in the Frontend and can be caught by any Forge jira module to get notified of the change.

I’m really looking for a JIRA_ISSUE_CHANGED equivalent for confluence. I want to update the content of a macro when the Confluence page has been updated.

1 Like

Hi @FabienLydoire
Currently, Confluence does not offer a direct way to subscribe to content changes on the front-end. However, we’ve developed a practical workaround to achieve similar functionality in one of our apps:

  1. Initial Page Versioning: When the front end is loaded, save the current version of the page.
  2. Long Polling for Updates: Implement a long polling mechanism to make a REST call that retrieves the latest version of the page. If the latest version is higher than the previously saved version, this indicates that the content has been updated.
  3. Trigger Notifications: Based on the updated content, apply any necessary changes, such as notifying the user or updating the display.

Thanks @AndreiPisklenov, that’s a nice workaround you proposed.

I wish Atlassian Team would answer this thread. If not, I’ll fill in a support ticket.
After all, switching to client/server arch with uikit2 makes those event mechanisms a necessity.