Trying to move Email (sys_email) entries when a case is transferred
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2019 03:23 AM
Hi,
I've been asked to try and move associated emails with a General Case to the transferred case. I've put a business rule in place which should do this. It looks like it works when looking at the sys_email table, but doesn't show up in the activity list of the new task. I have made sure that the sent/received emails is in the activity list for the form and that the user I am viewing the form with has the appropriate role to see sent and received emails.
// OnAfter 'insert' business role on sn_hr_core_case
// Condition 'Transferred from' is not empty
(function executeRule(current, previous /*null when async*/) {
var email = new GlideRecord('sys_email');
email.addQuery('instance', current.transferred_from.sys_id);
email.query();
while(email.next()) {
email.instance = current.sys_id;
email.target_table = current.sys_class_name;
email.update();
}
})(current, previous);
Old pre-transferred case, showing email:
Sys_email entry for above:
Transfer case:
No email in Activity list 😞
But the sys_email entry has been updated by the business rule:
- Labels:
-
Case and Knowledge Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2021 09:42 AM
Hi, Could you please share how was your fix and how toggle feature is added.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2021 05:46 AM
Hi Peter ,
Could you please let me know how was your fix , how you have written script for this ?