Copying Attachments from Parent to Child
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2019 07:55 AM
Hello all,
I have a question on how to get all of the parent attachments onto the child automatically. I currently have made a Business rule on the Parent table.
I feel like there is something obvious that I am missing. Any help is appreciated. Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2019 09:27 AM
I have looked into the relationship option but I would really prefer not to make a related list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2019 08:27 AM
I have also tried it with reversing the sourcetable and the destinationtable
and I have tried by adding the sys_ids... pretty much trying everything and nothing seems to be working...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2019 08:00 AM
You need to query change_task table first to find out sys_id of change task and then use below sample code
var donorTable = 'change_request'; var donorID = '2b6644b15f1021001c9b2572f2b47763'; var recipientTable = 'change_task'; var recipientID = '78e47fe94f31d200bf004a318110c7d4'; GlideSysAttachment.copy(donorTable, donorID, recipientTable, recipientID);
Regards,
SAchin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2019 08:00 AM
Hi,
You may refer this thread which was asked for similar requirement.
https://community.servicenow.com/community?id=community_question&sys_id=636a83e9db5cdbc01dcaf3231f9619eb
Hope this helps. Please mark the answer Correct/Helpful based on the impact.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2019 07:02 AM
Hello,
Not sure if you have something that works as needed since the thread is still open. So, I wanted to display what I have for doing this very thing (well, from HR Task table).
I have a UI Action that once clicked on by the Assigned To of an HR Task, it copies all attachments from the Parent HR Case.
GlideSysAttachment.copy(current.parent.sys_class_name, current.parent, current.getTableName(), current.sys_id);
current.update();
action.setRedirectURL(current);
gs.addInfoMessage("Attachments have been added!");
gsftSubmit(null, g_form.getFormElement(), 'sysverb_update_and_stay');
I am currently trying to see how to make this a selection rather than a one-off of copying ALL attachments. Sometimes from incoming emails, attachments can be part of someone's email signature which is annoying to be posted as an attachment.
Hope this helps - if you have a working solution, please let us know. And then if you could - close out this post.
Cheers!
-Rob