Send Event from Backend to Frontend

Hi, I have a custom ui project, where I want values in the UI to react to a Jira Issue Trigger.

I receive the Trigger event in the backend, but there is no way to “invoke” a function or send an event to my react frontend.

How do I “wire” my frontend to the trigger?

1 Like

Anyone? Seems like a reasonable use case to me that should be working. Somehow.

I can imagine that this could work only with web-sockets or some similar technology but I don’t think so Forge allow us using it. If I am not wrong, you can get data from BE only if this data was requested from FE, or you can push data from BE to FE via web-sockets or Server side push events.

I would use STORAGE API to store the value/s, and when FE is loaded i would just check if there are some new values.

Hi janambroz, thanks for your pointers.

I already save the new values in storage. I want to avoid having to manually refresh the page in order to see changes.

Is there any pointers on how to achieve this? The backend needs to notify the frontend to make a call. I didn’t find any luck using web sockets, and I did not find anything related to server side push events.

However, I noticed in https://global.discourse-cdn.com/atlassiandeveloper/original/3X/9/9/99c6c31707912cb9e94784a43f62e4670f59028a.png @kchan mentioned using something similar so I would appreciate any pointers

For now, I have a polling function that keeps invoking a function the backend resolver that returns the new data, but this is inefficient with regards to limits.

Is this really the only way?

Bumping this issue as it is really unclear to me if this is supported or not. I have seen some implementations where some sort of live data fetching was implemented but never how it was implemented and searching myself yields no results…

Bump, waiting for a reply from Atlassian Staff.

I’m sorry for tagging but @JoshuaHwang maybe?

Hi, this question fell through the cracks.

I’m unaware myself of any solution beyond polling. Will ask other team members though.

1 Like

Heard back from the team. Forge functions won’t work in this scenario.

It’s possible if you set up a websocket server (external to Forge) which your frontend can connect to. Adding that server’s address to the allowlist of external permissions for the client.

When a trigger occurs send the result externally to your websocket server which sends the info to the right websockets.

1 Like

Hi @JoshuaHwang , thanks for getting back with an idea. Is there anything on the roadmap that would allow this functionality in a more accessible manner?