Assign account to a ticket created with WebToCase

Assign account to a ticket created with WebToCase

We use Zoho Desk. Our large client uses WebToCase form to submit tickets.

I have two workflow rules:

When a contact is created and its email ends with example.com, it runs a custom function, which assigns the new contact the right account Example with ID 48000000012345678:

  1. orgId = 20071234567;
  2. accountId = "48000000012345678";
  3. recordValue = Map();
  4. recordValue.put("accountId",accountId);
  5. c = zoho.desk.update(orgId,"Contacts",contactId,recordValue,"zohodeskcontactupdate");
  6. info c;

That results with the contact belonging to the account. I see "accountId":"48000000012345678" in the response.

The other workflow rule is similar. When a new ticket is created, and its email ends with example.com, it runs a custom function, which should assign the new contact the same account:

  1. orgId = 20071234567;
  2. accountId = "48000000012345678";
  3. recordValue = Map();
  4. recordValue.put("accountId",accountId);
  5. t = zoho.desk.update(orgId,"Tickets",ticketId,recordValue,"zohodeskcontactupdate");

But the ticket is not associated with the account. I see "accountId":null in the result.

The issue is also somewhat intermittent, as during the development, sometimes it actually worked.