what is the best and safest way to copy emails ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hello,
I've created a UI action on "sn_customerservice_case" table to duplicate cases.
the ui action copy all field from parent case , and set it as a parent of the copied one.
i would like to copy all emails ( or display them in the child case)
what is the best approach ?
thank you in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
@ammar_k ,
Safest and most maintainable way to copy emails when duplicating a case is to explicitly copy the related sys_email records and link them to the new case rather than trying to rely on the activity stream auto linking, because oob snow doesn’t automatically propagate emails from one case to another when you clone a case record and......attachments or email entries need to be manually duplicated, so you would capture the parent case sys_email records in your ui action or in an after insert business rule.......use GlideRecord to query the sys_email entries related to the parent case, and then create or copy new sys_email records for the child case while maintaining the correct target and activity references...... typically using GlideSysAttachment.copy() for attachments if needed, and ensuring the logic runs after the new case has been inserted so the new case sys_id is available for linking,.....because simply copying fields on the case won’t include the email history or activity stream without that explicit script or flow handling.......
If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/