Copy attachments from email when using cart object in inbound action, set target record

 see 

https://community.servicenow.com/community?id=community_question&sys_id=d9c73a60db483f8413b5fb24399619bd

it seems that you need to get the sys_id of the REQ table

GlideSysAttachment.copy('sys_email', sys_email.sys_id, 'sc_request', rc.sys_id);


https://community.servicenow.com/community?id=community_question&sys_id=927007e1db98dbc01dcaf3231f961970

set target to the REQ table

sys_email.target_table = "sc_request";
sys_email.instance = rc.sys_id;

or RITM table

if(rc != undefined){
var gr = new GlideRecord("sc_req_item");
gr.addQuery("request", rc.sys_id);
gr.query();

if(gr.next()){
sys_email.target_table = "sc_req_item";
sys_email.instance = gr.sys_id;
sys_email.update();

}
}

Comments

Popular posts from this blog

GlideRecord setValue

variable advanced reference qualifier example

Running transform maps asynchronously