how to download Attachment from the incident ticket using Servicenow Orchestration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2016 09:43 PM
I need to download the Attachment from Incident Ticket when the Ticket is create and do some excel manipulation in that file

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2016 11:21 PM
Where do you want to download the file to? A client (via browser), or to a Server in the customer infrastructure?
If it's that latter, what I've done in the past is create a custom activity (JDBC-Probe) that sends the file to the MID Server. There you can then do some manipulation, probably using some PowerShell scripts, and send it back.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2016 11:53 PM
Hi Julian,
As you mention i have trying to download the attachment using Vb Script i and passing the URL and downloading the file , But while execute that VB script Manual i am able to execute and i am able to download the file, But While i am trigger the vb,script by Servicenow Using powershell, I am not able to download, In that VB Script i am fetch file using REST API from Attachment table ,
When Executing the VB Script by double click i am able to download but from Service now orchestration it was not working . I was triggering the error message as MSXML3 is not locate
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2016 09:55 PM
Hi Julian,
Is it possbile to take how you have done custom activity (JDBC-Probe) that sends the file to the MID Server. That will be helpful for me

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2016 12:15 AM
I haven't done any Excel manipulation on the Server but to download the file to the MID-Server I used the following activity that pushes the file to the MID server that I included in the Workflows:
The actual script is in a MID Server Script Include:
var DownloadFile = Class.create();
DownloadFile.prototype = {
initialize: function () {
var fc = probe.getParameter("fileContent");
this.fileContent = Packages.com.glide.util.StringUtil.base64Decode(fc);
this.fileName = probe.getParameter("fileName");
this.execute();
},
execute: function() {
var f = new Packages.java.io.File(this.fileName);
var out = new Packages.java.io.FileOutputStream(f);
var str = this.fileContent;
var s = new Packages.java.lang.String(str);
var b = s.getBytes();
out['write(byte[])'](b);
out.close();
},
type: DownloadFile
};
Hope that helps.