Issue with Serverless Events: onTicketUpdate Not Returning Data, onConversationCreate Not Triggering

Hi,

We are working on serverless events onTicketUpdate and onConversationCreate. The events are successfully triggered in the local environment. However, when testing as a custom app, onTicketUpdate is triggered, but it does not return the required details. Additionally, onConversationCreate is not triggered at all.

Please find attached the server.js code along with screenshots of the local and production environments.

exports = {
  onTicketCreateHandler: function (args) {
    console.log("Hello " + args["data"]["requester"]["name"]);
  },

  onTicketUpdateHandler: function (args) {
    console.log(args, "------------->ticket update");
    console.log(
      args?.data?.ticket?.associated_changes,
      "------------ticket update"
    );
    console.log(args?.data?.changes, "-------------->ticket changes");
  },

  onConversationCreateCallback: function (payload) {
    console.log(args, "------------>ticket conversation");
    console.log(
      payload.data.conversation,
      "-------------->ticket conversation"
    );
  },
};

Hi @Claret_Ivin,

Greetings!

Could you please share the manifest with us?

In the meantime, could you please raise a support ticket?

Thank you.

Hi Benny,

Please find the manifest.json code along with the screenshots,


{
"platform-version": "2.3",
"product": {
"freshservice": {
"events": {
"onTicketCreate": {
"handler": "onTicketCreateHandler"
},
"onTicketUpdate": {
"handler": "onTicketUpdateHandler"
},
"onConversationCreate": {
"handler": "onConversationCreateCallback"
}
}
}
},
"engines": {
"node": "18.15.0",
"fdk": "9.3.1"
}
}

Hi Claret,

console.log(args?.data?.changes, “-------------->ticket changes”);

it should be console.log(args?.data?.ticket?.changes, “-------------->ticket changes”);

args?.data?.ticket?.associated_changes → associated_changes will be present only when the updated ticket has associated_changes to it.

regarding this

onConversationCreateCallback: function (payload) {
console.log(args, “------------>ticket conversation”);
console.log(
payload.data.conversation,
“-------------->ticket conversation”
);
},

it should be defined as

onConversationCreateCallback: function (payload) {
console.log(payload, “------------>ticket conversation”);
console.log(
payload.data.conversation,
“-------------->ticket conversation”
);
},

Hi Sandeep,

I’ve tried using the expression console.log(args?.data?.ticket?.changes, “-------------->ticket changes”). While this appears to work in the custom app, it returns “undefined” in my local environment.

I noticed in the documentation that "changes" is listed as a separate attribute. Could you please confirm whether the JSON structure in the documentation is accurate and consistent with the JSON structure returned in the portal? I’ve attached a screenshot of the attributes for your reference.

For “onConversationCreate” I changed from args to payload. I couldn’t see any event triggered when a reply or note is created.

Thanks,
Claret Ivin

HI Claret,

The documentation indeed has a mistake with respect to changes in onTicketUpdate, I will check with the corresponding team to get it corrected.

Can you please share the ticket details like display id, account id, reply created time for which conversation callbacks are not triggered, so that we can debug and check.

Thanks
Sandeep

Hi Sandeep,

Thanks for the update. Please find the ticket details and conversation details for which the conversation callbacks are not triggered.

{
“id”: 11111798472,
“user_id”: 11002487642,
“to_emails”: [
clareti@techaffinity.com
],
“body”: “<div style="font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; font-size: 14px; ">

Hi Claret Ivin R,

Ticket: <a href="[Freshworks](Freshworks)” rel="noreferrer">https://techaffinityinc.freshservice.com/helpdesk/tickets/1147
",
“body_text”: “Hi Claret Ivin R, Ticket: Freshworks”,
“ticket_id”: 1147,
“created_at”: “2025-04-03T12:25:57Z”,
“updated_at”: “2025-04-03T12:25:57Z”,
“incoming”: false,
“private”: false,
“support_email”: “helpdesk@techaffinityinc.freshservice.com”,
“source”: 0,
“from_email”: “techaffinityinc <helpdesk@techaffinityinc.freshservice.com>”,
“cc_emails”: ,
“bcc_emails”: ,
“attachments”:
},

Thanks,
Claret Ivin

(Attachment dummyt.json is missing)

Hi Sandeep,

I hope you’re doing well.

Could you please provide an update on the ticket and conversation details?

Thanks,
Claret Ivin

Hi Tushar,

My apologies for the delayed response. We’re now seeing that the event is triggering correctly. Thank you for your assistance!

Thanks,
Claret Ivin