onTicketUpdate event not working

When we tried ticket update event not working properly. here attached my fdk file for your reference
freshplug.zip (50.1 KB)

Hi @Vignesh-Agiratech

Good Day!

Will check and keep you posted here, Maybe can you please share more information on the issue you are facing.

Thanks

Hi @Vignesh-Agiratech

After analyzing your code, You are trying to get the custom_fields from the ticket object. Below is the sample response for the custom_field

"custom_fields": {
  "cf_aefds_11010177632": "category 1",
  "cf_sda_11010177632": "subcategory 1",
  "cf_check_test_11010177632": true,
  "cf_pick_list_test_11010177632": "option 1"
}

In the onTicketUpdateCallback Function, you forgot to add the account id at the end of the custom_field name. So, Try to add accountId at the end of the custom field name. Please refer to the below code snippet

// This is your code
var category = ticket.custom_fields.cf_product_type;
var reason = ticket.custom_fields.cf_new_reason_for_interaction;

// Corrected code need to append _<accountId> at the end of the customField name
var category = ticket.custom_fields.cf_product_type_11010177632;
var reason = ticket.custom_fields.cf_new_reason_for_interaction_11010177632;

Hope this will help you to solve the issue,

Thanks

After change the fields onTicketUpdateCallback not yet working properly. below shared the updated code and postman collection for your reference
freshplug.zip (50.0 KB)
subject-not-updated

Thanks for explaining the issue which you are facing in a private message.

The issue faced by the @Vignesh-Agiratech
He is trying to update the ticket subject in onTicketUpdateCallback. But it is not updating.

I have checked your updated code everything works fine. But the ticket subject is not updating immediately, Once after refreshing the page we can see the updated value in the ticket subject. I will check this issue with the team and get back to you shortly.

Thanks

Thanks for the update. We need resolve the issue as soon as possible

@Vignesh-Agiratech

The product APIs work in the ways that they fetch the updated information not immediately but sometimes after a reload. This is the expected behavior as of today. We can treat this as a feature request and put it forward to the @Freshdesk team.

Hi @Saif,

How long api takes to update the subject because the client is asking the same thing to us.

If you try to make an API call via a tool like postman, you should be able to see the time response time it takes to give you 200 OK. It’s about same time it takes. However, the UI doesn’t reflect the changes until refreshed.