Enable inheritance of attachments from RITM to SCTASK

RMendoza
Tera Expert

Hello,

We are 8mths into the implementation of ServiceNow and still trying to learn the system.  

Our agency uses the ServiceNow Workspace, and we would like attachments from the RITM to display on the SCTASK within the Workspace.  After some research, I discovered that creating a property could enable this functionality.  I proceeded to create the property, but after testing, it seems that it may not have been set up correctly.

I'm sure it's user error, so any assistance is appreciated.

 

Also, any suggestions as to what classes I can take to learn more about properties, acl's, business rules?  

3 REPLIES 3

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @RMendoza 

 

https://www.servicenow.com/community/now-platform-forum/copy-attachment-from-ritm-to-sc-task-on-requ...

 

https://www.servicenow.com/community/developer-articles/copy-attachments-ritm-to-task-task-to-ritm-w...

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Ankur Bawiskar
Tera Patron
Tera Patron

@RMendoza 

please share what property was used.

I don't think OOB there is any property which shows attachments from RITM on SCTASK

There are 2 ways

1) either copy all attachments from RITM to SC TASK when SC Task is created using after insert BR on sc_task table

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	GlideSysAttachment.copy('sc_req_item', current.request_item, 'sc_task', current.sys_id);

})(current, previous);

OR

2) show the attachments as related list on SC TASK. This will avoid copying same file again on sc_task

check this link

TNT: "Related Attachments" Related List 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Runjay Patel
Giga Sage

Hi @RMendoza ,

 

You can write after insert/update BR and use below code. this will copy all the attachment from ritm to sc_task.

(function executeRule(current, previous /*null when async*/) {
    // Ensure the RITM (parent) has attachments
    var parentRITM = new GlideRecord('sc_req_item');
    if (parentRITM.get(current.parent.sys_id)) {
        // Copy attachments from RITM to SCTASK
        GlideSysAttachment.copy('sc_req_item', parentRITM.sys_id, 'sc_task', current.sys_id);
    }
})(current, previous);

 

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------