If mail id is in cc the email response should converted to comments in the task

Tharshani Ravi
Tera Expert

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.

 

1 REPLY 1

swathisarang98
Giga Sage
Giga Sage

Hi @Tharshani Ravi ,

 

You can create after Insert br as below,

Table: sys_email

condition: type=reply and add any other condition if needed.

swathisarang98_0-1715894011844.png

 

 

(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