If mail id is in cc the email response should converted to comments in the task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 10:30 AM
Hi ALL,
I have a requirement, in the email response if the system mail id is in CC the email body should be converted to comments in the task. I have tried to create an "Inbound email action" using email.cc
when to run : type=reply
But it wasn't working as expected.
Please let me know if there is a way.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 02:14 PM - edited 05-16-2024 02:15 PM
Hi @Tharshani Ravi ,
You can create after Insert br as below,
Table: sys_email
condition: type=reply and add any other condition if needed.
(function executeRule(current, previous /*null when async*/ ) {
// gs.info('sys_id ' + current.instance);// gs.info('CC ' + current.copied);
var gr = new GlideRecord('sc_task');
gr.addQuery('sys_id', current.instance);
var copiedField = current.copied;
gr.query();
if (gr.next()) {
//gs.info('inside if');
//gr.state = 1 ;
gr.work_notes.setJournalEntry('Subject: ' +current.subject);
gr.work_notes.setJournalEntry('CC: '+copiedField);
gr.update();
}
})(current, previous);
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang