Issue onEmployeeUpdate product event

Issue with onEmployeeUpdate product event in Freshteam. If we try to update First Name, Last Name and Official Email at same time, First Name and Last Name changes are capture in the changes object of onEmployeeUpdate Playload. But if we try to update only First Name and Last Name changes are captured in changes object of onEmployeeUpdate Playload.

Code:

onEmployeeUpdateHandler: function(employeeUpdatePayload) {
        console.log("Employee changes made:",employeeUpdatePayload.data.changes);
}

logs: After updating employee First Name, Last Name and Official Email at same time.
Employee changes made:

{ model_changes: { official_email: [ 'testeams12@freshservice.com', 'testteams12@freshservice.com' ] } }

@Durga_Devineni

Is this behavior the same case in local testing with fdk and also in production when you publish it as a custom app?

What specifically happens in the above case? I understood when you update (first, last and official email address) you see the changes reflected in the payload. But what happens when user updates only first and last names? The changes do not reflect in the payload?

@Saif

onEmployeeUpdate product event is capturing partial payload information. when we try to update First Name, Last Name and Official Email at same time then the changes object of onEmployeeUpdate payload is:

{ model_changes: { official_email: [ 'testeams12@freshservice.com', 'testteams12@freshservice.com' ] } 
}

In the above payload changes made on First Name and Last Name are missing.

1 Like

I can reproduce the issue. I updated the first name, last name, and official email, but I only see the official email in the changes payload. This should be treated as a bug.

I have put you in touch with the Freshteam product team. You are welcome to follow up with them for further updates.

@Durga_Devineni - There’s a new ticket that’s created for you to get you help. Please access it here.