I want to copy attachment from RITM to SCTASK record

Abhilash Janga1
ServiceNow Employee
ServiceNow Employee

I am trying to copy attachment from RITM to SCTASK record. I have written after-insert BR for that. its working when i submit the request by submitting the cat item. but to create RITM & SCTASK i have created one Inbound mail Action. its not working there. In the inbound mail action i have selected target table as "sc_req_item". So , the attachments coming from mail are getting attached directly to RITM record. but i want to copy the same attachments from the RITM to SCTASK record.

GlideSysAttachment.copy('sc_req_item', current.request_item, 'sc_task', current.sys_id);

This is the code i am using for copying attachment. Please if you can help. where should i debugg?

1 ACCEPTED SOLUTION

@Koki 

Hope you are doing good.

Did my reply answer your question?

If my response helped you please mark it correct to close the question so that it benefits future readers as well.

Regards
Ankur

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

10 REPLIES 10

@Koki 

Hope you are doing good.

Did my reply answer your question?

If my response helped you please mark it correct to close the question so that it benefits future readers as well.

Regards
Ankur

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader