Rule and Custom Function Help

Rule and Custom Function Help

Hoping to get some help on my idea with our ticket creation. We currently have our own support email that receives numerous requests from end users. There are certain requests that I will be forwarding to our Zoho Desk email and a ticket is automatically created. These emails are always the same format and have the same subject line, only certain data within will change.

I have created a new layout of ticket with custom fields for these types of requests.

My plan is the following:

1.       When the ticket is created via email, it is converted to the new layout based upon the subject line, so the custom fields are visible.

2.       The custom fields are populated with the information received via email. The information is:

a.       Dealer Region

b.       Dealer Number

c.       Dealer Email Address

3.       With these values I need to do a look up against a list to then populate another custom field that the agent will use to action on our system.

I have tried to have a look and found https://help.zoho.com/portal/en/community/topic/automation-11-auto-update-custom-fields-with-values-from-emails which I based my custom function on however when it executes against the ticket I get: ‘Value is empty and 'subText' function cannot be applied


Here is my current function, I have only attempted to get the information from the email first before trying to lookup and populate a custom field

orgId = "********";

dealerNoFromWord = "Dealer Number:";

dealerNoToWord = "Region:";

regionFromWord = "Region: ";

regionToWord = "Full Name: ";

emailFromWord = "Email Address:";

emailToWord = "Many thanks,";

lendealerNoFromWord = dealerNoFromWord.length();

lenregionFromWord = regionFromWord.length();

lenemailFromWord = emailFromWord.length();

T_Info = invokeurl

[

              url :"https://desk.zoho.com/api/v1/tickets/" + TicketID + "/latestThread?include=plainText"

              type :GET

              connection:"zohodesk"

];

info T_Info;

plainText = T_Info.getJSON("plainText");

dealerNumber = plainText.subText(plainText.indexOf(dealerNoFromWord) + lendealerNoFromWord,plainText.indexOf(dealerNoToWord));

region = plainText.subText(plainText.indexOf(regionFromWord) + lenregionFromWord,plainText.indexOf(regionToWord));

email = plainText.subText(plainText.indexOf(emailFromWord) + lenemailFromWord ,plainText.indexOf(emailToWord));

updateTicket = zoho.desk.update(orgId,"tickets",TicketID,{"cf":{"cf_dealer_number_string":dealerNumber}});

updateTicket = zoho.desk.update(orgId,"tickets",TicketID,{"cf":{"cf_dealer_region_string":region}});

updateTicket = zoho.desk.update(orgId,"tickets",TicketID,{"cf":{"cf_dealer_email":email}});

info updateTicket;

And this is the format the emails are received:

Hi *****,

We've been notifed that the following user had left the ****** dealer network.

Please can you reset the password according to our agreed process.

Dealer Number: *****

Region: *****
Full Name: ***** *****
Email Address: ******************

Many thanks,

***** (*** Support Team)

Any help/suggestions will be greatly appreciated.




      • Sticky Posts

      • Webinar 2: Supercharged customer support for growing business

        Join us for this webinar and learn how to step up your support game using a real-time communication platform to generate happier, more successful customers. In this live webinar, we will will discuss the importance of SalesIQ for your support team and how it can help you:  Understand your customers better and their journeys to proactively support and engage them even before they ask for help.  Integrating real time conversations into Zoho Desk’s Support, providing a conversational customer service
      • Customize Colors of your Customer Self Service Portal

        You asked for it. We heard you. We're happy to roll out the most sought after feature request, Customizing the Colors of your Customer Self-service Portal. Now you can set the color of your customer portal to mimic your company's web site, so that your customers visiting the portal will not feel alienated by the default theme.  Go ahead and configure the color of the header, tabs, fonts and background according to your needs. You can either choose between default color themes like Blue, Grey, Green
      • Edit and Delete options in Comments

        A lot of teams have been using ticket comments extensively to collaborate everyday. Notification Center further improved this experience by bringing real-time updates. As we continue to build more improvements to this experience, we've shipped a small-yet-important
      • 2024 Email Authentication Standards: Elevating Security with Google and Yahoo

        In contemporary email communication, email authentication plays a pivotal role in mitigating email fraud, spam, and phishing attacks. Brace yourself for a new level of security. Starting February 2024, Gmail and Yahoo will be implementing robust email
      • Announcing the New and Improved Article Editor

        KBase articles are known to help customers, find solutions to problems on their own and set the stage for ticket deflection. That said, the way you present your KBase content is the clinching factor that ensures your customers stick around to consume it.  We took it upon ourselves to build an editor that allows you to publish articles without delving into the code. Well, at least for the most part. With more options and a redefined interface, the article editor in Zoho Desk is now better than ever!