Jaspal Singh
Mega Patron

Hi Irfan,

 

Try using below in background script for a check.

var insertattach=new GlideRecord('sys_attachment');
insertattach.initialize();
var gsa = new GlideSysAttachment();
var attachmentId = gsa.write(insertattach, "JaspalTest.txt", 'text/plain', "Data is here");
//JaspalTest-Filename .txt-is type 
//Data is here is the content of the document

 

Try changing .txt to .doc & replace "Data is here" with the content of the word document