Function to change status of shipment after 3 days

Function to change status of shipment after 3 days

Hello!

I am trying to make a function that through a workflow, changes the status of the shipment to "delivered" after 3 days. The 3 days time is made with the workflow, but the update function is not working. When I try to debug it always give me this error: 
Check and update the code in line 13 as there is a Exception : Value is empty and 'getJSON' function cannot be applied

This is the code. Can someone tell me what I am doing wrong? 


  1. salesorderID = salesorder.get("salesorder_id");
  2. organizationID = organization.get("organization_id");
  3. authtoken = "02bxxx";
  4. response = zoho.inventory.getRecordsByID("SalesOrders",organizationID,salesorderID);
  5. listaPaquetes = response.getJSON("salesorder").getJSON("packages").toJSONList();
  6. for each  paquete in listaPaquetes
  7. {
  8. packid = response.getJSON("salesorder").getJSON("packages").getJSON("package_id");
  9. if(!paquete.getJSON("status").isempty())
  10. {
  11. estadoPaquete = paquete.getJSON("status");
  12. }
  13. if(estadoPaquete = "not_shipped")
  14. {
  15. item = Map();
  16. item.put("status","delivered");
  17. info item;
  18. response = zoho.inventory.updateRecord("Packages","organizationID","packid",item);
  19. info response;
  20. }
  21. // info item;
  22. }