Enter a Function Name and add the function in the Deluge Script Editor.
Enter the following code. You need to create a
connection for FSM named zfsm.
adminEmail = organization.get("primary_email");
attachmentsResp = notes.get("$attachments");
file_attachment_list = List();
reqName = request.get("Name");
if(attachmentsResp.isNull())
{
info "No attachment present in the Note !!!";
}
else
{
attachments_list = attachmentsResp.toList();
}
for each attachment in attachments_list
{
file_id = attachment.get("$file_id");
fileResp = invokeurl
[
url :"https://fsm.zoho.com/fsm/v1/files?file_id=" + file_id
type :GET
connection:"zfsm"
];
file_attachment_list.add(fileResp);
}
sendmail
[
from :zoho.adminuserid
to :adminEmail
subject :"Request " + reqName + " Escalated !!!"
message :"This request has been escalated. PFA the supporting attachments."
Attachments :file:file_attachment_list
]
