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.

    Access your files securely from anywhere

        Zoho FSM Video Tutorials


              All-in-one knowledge management and training platform for your employees and customers.






                                    Zoho Developer Community




                                                          • Desk Community Learning Series


                                                          • Digest


                                                          • Functions


                                                          • Meetups


                                                          • Kbase


                                                          • Resources


                                                          • Glossary


                                                          • Desk Marketplace


                                                          • MVP Corner


                                                          • Word of the Day


                                                          • Ask the Experts





                                                                    Manage your brands on social media



                                                                          Zoho TeamInbox Resources



                                                                              Zoho CRM Plus Resources

                                                                                Zoho Books Resources


                                                                                  Zoho Billing Resources

                                                                                    Zoho Projects Resources


                                                                                      Zoho Sprints Resources


                                                                                        Qntrl Resources


                                                                                          Zoho Creator Resources



                                                                                              Zoho CRM Resources

                                                                                              • CRM Community Learning Series

                                                                                                CRM Community Learning Series


                                                                                              • Kaizen

                                                                                                Kaizen

                                                                                              • Functions

                                                                                                Functions

                                                                                              • Meetups

                                                                                                Meetups

                                                                                              • Kbase

                                                                                                Kbase

                                                                                              • Resources

                                                                                                Resources

                                                                                              • Digest

                                                                                                Digest

                                                                                              • CRM Marketplace

                                                                                                CRM Marketplace

                                                                                              • MVP Corner

                                                                                                MVP Corner









                                                                                                  Design. Discuss. Deliver.

                                                                                                  Create visually engaging stories with Zoho Show.

                                                                                                  Get Started Now


                                                                                                    Zoho Show Resources

                                                                                                      Zoho Writer

                                                                                                      Get Started. Write Away!

                                                                                                      Writer is a powerful online word processor, designed for collaborative work.

                                                                                                        Zoho CRM コンテンツ




                                                                                                          Nederlandse Hulpbronnen


                                                                                                              ご検討中の方