-
ticketInfo = invokeurl
-
[
-
url :'https://desk。Zoho。com/api/v1/チケット/' + ticketid + ''
-
種類 :取得する
-
connection:'desk'
-
];
-
-
contactId = ticketInfo。getJSON('contactId');
-
contactInfo = invokeurl
-
[
-
url :'https://desk。Zoho。com/api/v1/連絡先/' + contactId + ''
-
種類 :取得する
-
connection:'desk'
-
];
-
info contactInfo;
-
-
crmContactID = contactInfo。getJSON('zohoCRMContact').取得する('id');
-
-
latestThreadInfo = invokeurl
-
[
-
url :'https://desk。Zoho。com/api/v1/チケット/' + ticketid + '/latestThread'
-
種類 :取得する
-
connection:'desk'
-
];
-
-
attachmentsInfo = latestThreadInfo。取得する('添付ファイル');
-
-
for each 添付ファイル in attachmentsInfo
-
{
-
attachmentURL = 添付ファイル。取得する('href');
-
fileName = 添付ファイル。取得する('名前');
-
-
getAttachment = invokeurl
-
[
-
url :attachmentURL
-
種類 :取得する
-
connection:'testa'
-
];
-
-
if(getAttachment != null)
-
{
-
if(isText(getAttachment))
-
{
-
getAttachment = getAttachment。toFile(filename);
-
}
-
param = Map();
-
param。put(fileName,getAttachment);
-
getAttachment。setParamName('file');
-
info 'getAttachment:' + getAttachment;
-
uploadAttachment = Zoho。crm。attachFile('連絡先',crmContactID,getAttachment,'crm');
-
info uploadAttachment;
-
}
-
}