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.