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.

Send attachments to Mid Server

prabh
Mega Expert

Hi All,

How can I send attachments from Service now instance to a folder in mid server

41 REPLIES 41

Hi



You can add ms.log(); lines to the script include. Then look in mid server log file for errors or to see where the script is failing.



Shane


Also thanks for the script!
I just couldn't figure out how to write to the mid-server!

1 problem though, it writes a file now, but I can't open it? Seems to be corrupted 😞

Ow and where can I see this Mid server log file? Can't find my ms.loggings anywhere...

 

Cheers Chris

Ok I fixed the problem by doing this:

//var strData = String(Packages.java.lang.String(binData));
var encData = GlideStringUtil.base64Encode(binData);

By not converting the binData to string and using it directly for the base64encode action the file isn't corrupted anymore 🙂

Thanks It is useful for me also thanks 

 

iros
Kilo Contributor

Hi! I am using the above scripts on my instance. 

I am still having some trouble. The file now shows up in the folder on the MID server, but the content of the file is missing. Do you have any suggestions?