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.

GlideSysAttachment Business rule not adding attachment

Kearney
Tera Contributor

I have an inbound action which creates a request and child RITM. The inbound action runs on the sc_request table so by default the attachments get added to the request. I have created a BR which runs After insert on the sc_req_item table however I cannot get the attachment to add on insert at all
--BR Code--

var att = new GlideSysAttachment();
var copiedAtt = att.copy('sc_request', current.request, 'sc_req_item', current.sys_id);

 
Any help is appreciated!
Thanks

1 REPLY 1

Sandeep Rajput
Tera Patron
Tera Patron

@Kearney Could you please update the script as follows and check it it works.

 

var att = new GlideSysAttachment();
var copiedAtt = att.copy('sc_request', current.getValue('request'), 'sc_req_item', current.getValue('sys_id'));

Hope this works.