email script for signature [Please see description]

snow34
Tera Contributor

I want to give signature at the footer as pe assignment group f

For example: If assignment group is abc then signature of abc assignment group should be there 

1 ACCEPTED SOLUTION

You need to create signatures in notification email scripts for each assignment group. you can take below reference.

(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
    /* Optional EmailOutbound */
    email, /* Optional GlideRecord */ email_action,
    /* Optional GlideRecord */
    event) {


    var group1_name = "Grpup1_name";
    var group1_sys_id = "group1_sys_id";
    var group1_description = "Group1 description";

    var group2_name = group2_name;
    var group2_sys_id = "group2_sys_id";
    var group2_description = "Group2 description";



    if (group1_sys_id == current.assignment_group) { // add Group1 - email signature

        template.print("Thanks and Regards," + "<br />" +
            group1_name + "<br />" +
            group1_description + "<br />");
		
    } else if (group2_sys_id == current.assignment_group) { // add Group1 - email signature

        template.print("Best Regards," + "<br />" +
            group2_name + "<br />" +
            group2_description + "<br />");
    }



})(current, template, email, email_action, event);

 

Thanks!

Sagar Pagar

The world works with ServiceNow

View solution in original post

12 REPLIES 12

You need to create signatures in notification email scripts for each assignment group. you can take below reference.

(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
    /* Optional EmailOutbound */
    email, /* Optional GlideRecord */ email_action,
    /* Optional GlideRecord */
    event) {


    var group1_name = "Grpup1_name";
    var group1_sys_id = "group1_sys_id";
    var group1_description = "Group1 description";

    var group2_name = group2_name;
    var group2_sys_id = "group2_sys_id";
    var group2_description = "Group2 description";



    if (group1_sys_id == current.assignment_group) { // add Group1 - email signature

        template.print("Thanks and Regards," + "<br />" +
            group1_name + "<br />" +
            group1_description + "<br />");
		
    } else if (group2_sys_id == current.assignment_group) { // add Group1 - email signature

        template.print("Best Regards," + "<br />" +
            group2_name + "<br />" +
            group2_description + "<br />");
    }



})(current, template, email, email_action, event);

 

Thanks!

Sagar Pagar

The world works with ServiceNow

But there are too many groups so for every group i need to paas sys id ? is there any dynamic way

snow34
Tera Contributor

can i pass sys_id of the parent group ?