Adding Assignment group in CC of a notification

Aasrita
Tera Contributor

Hello All,

 

Can someone help me how to add an assignment group(of that change request) in cc when an email is triggering to change request approvers?

Example- Change request is assigned to 'example_group'. We need to add example_group in cc when email is triggering to change request approvers.

1 REPLY 1

Danish Bhairag2
Tera Sage
Tera Sage

Hi @Aasrita ,

 

You can do this using email script. For eg You have your notification created on change request table. In your email body call a mail script like this ${mail_script:script_name} // provide your email script name here

 

Create a email script which u going to call above. In that u can write 

var gr = new GlideRecord("sys_user_grmember");
	gr.addQuery("group", current.assignment_group); // give here the group name
	gr.addEncodedQuery("user.emailISNOTEMPTY");
	gr.query();
	while(gr.next()) {
		email.addAddress("cc", gr.user.email, gr.user.getDisplayValue());
	}	

  

Thanks,

Danish