Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

attachment issues

Jack62
Giga Guru

I have tried logging this a few times but I am getting marked as spam. Can anyone confirm if the below script in my business rule should send an attachment through Rest? once confirmed I will send the error I am seeing in the logs.

 

var parser = new JSONParser();
var parsed = parser.parse(responseBody);
var targetRec = parsed.result;
var attachmentCount = sendAttachments(current.getTableName(),
current.sys_id, targetRec.sys_id);
if (attachmentCount != "none") {
attachmentMsg = " Attachments successfully sent: " +
attachmentCount[0].toString() + ". Attachments failed to be sent: " +
attachmentCount[1].toString();
} else {
attachmentMsg = " Record had no attachments to send.";
}
5 REPLIES 5

Jack62
Giga Guru

Afternoon.

 

We are now further forward and attachments are now being received but only if we send a PDF file. Any other file is ignored. In our script above we are setting the file type to match what is attached but with or without that set we are only able to send PDFs. 

 

Any thoughts?

 

Jack