Update ticket Field in zoho desk

Update ticket Field in zoho desk

I'm a beginner at using Custom Function on the Zoho desk; I'm trying to update a field in the ticket template.

I have 2 fields in the ticket template [KM, COST].

The cost should equal 2*KM. For example, if KM = 100, then Cost = 200.

I created a workflow that works if the KM is updated and attached the following custom function code, but the field doesn't update. olehana france

orgId = "718524341";
response = zoho.desk.getRecordById(orgId,"tickets",TicketID,"zohodesk");
cid = response.get('cf_km');
km_cost = cid * 2;
zoho.desk.update(orgId,"tickets",TicketID,{"cf":{"cf_cost":km_cost}},"zohodesk");