Hi everyone,
I’m developing a Freshdesk app to enhance the process of updating company notes, and I’m facing some challenges with syncing data between the backend onConversationCreate
event and the frontend ticket.addNote
event. Here’s an overview of what I want to achieve and the obstacles I’ve encountered.
Goal:
- Capture Note Privacy Status: I need to determine if a note added to a ticket is private or public.
- Conditional Company Notes Update: If the note is private, I want to prompt the agent with a confirmation dialog, allowing them to decide whether to append it to the company’s notes.
Current Approach:
- Backend with
onConversationCreate
Event: I’m using theonConversationCreate
event to capture the privacy status of the note (private or public) and store this data in$db.set()
. When I test locally by navigating tolocalhost:10001/web/test
, I can see the events being triggered as expected. However, when running the app, it seems that I’m not receiving any console logs or confirmations that the data is being stored—possibly due to the serverless nature of the backend. - Frontend with
ticket.addNote
Event: I’m using theticket.addNote
event in the frontend to show the confirmation dialog. However, sinceticket.addNote
doesn’t provide information about the note’s privacy status, it’s difficult to conditionally display the dialog based on the note type.
Attempted Workaround:
I tried to store the note’s privacy status using $db.set()
in the backend and then retrieve it in the frontend after ticket.addNote
is triggered. Unfortunately, this approach hasn’t worked—I keep encountering a “not found” error, and it seems like onConversationCreateHandler
may not be storing the data correctly.
Questions:
- Is there a recommended approach to reliably sync data between backend/serverless events and frontend click events in Freshdesk apps?
- Are there any best practices for triggering frontend actions based on backend events like
onConversationCreate
? - Should I consider managing this functionality solely in the backend? If so, how can I effectively implement a confirmation dialog in the backend or notify the frontend?
Any advice or insights would be greatly appreciated!
Thanks in advance for your help!