Untitled

 avatar
unknown
plain_text
3 years ago
1.3 kB
1
Indexable
TicketId = 220275001674489015;
//getDetails = zoho.desk.getRecordById(ORGID,"tickets",TicketId,"zohodesk");
getDetails = invokeurl
[
	url :"https://desk.zoho.com/api/v1/tickets/" + TicketId + "?include=contacts"
	type :GET
	connection:"zohodeskallnew"
];
// info "\nget Details===>" + getDetails;
Ticket_No = getDetails.get("resolution");
info "\n\n\n" + Ticket_No;
email_message = Ticket_No;
contactt = getDetails.get("contact");
info "\n\n\n" + contactt;
idd = contactt.get("id");
info "\n\n\n" + idd;
searchingAgents = zoho.desk.getRecordById(ORGID,"Contacts",idd);
info "\n\n searchinAgents =>" + searchingAgents;
emaill = searchingAgents.get("email");
info "\n\n\n" + emaill;
jsonString = Map();
jsonString.put("channel","EMAIL");
jsonString.put("to",emaill);
//Specify the recipient 
jsonString.put("fromEmailAddress","support@indiainfoline476.zohodesk.com");
// Provide the from email address
jsonString.put("contentType","plainText");
//you can also select contentType as plaintext
jsonString.put("content",email_message);
jsonString.put("isForward","false");
sendReply = invokeurl
[
	url :"https://desk.zoho.com/api/v1/tickets/" + TicketId + "/sendReply"
	type :POST
	parameters:jsonString.toString()
	connection:"zohodeskallnew"
];
info "\n\nsendReply====>" + sendReply;