Email Script to display change type in colour in Change Approval Request notification

Mi Mi
Tera Contributor

Hi

I need to update our current change approval request notification to display the change type in colour based on the type. For example,

Emergency = Red

Expedited = Orange

Normal = Blue

Is it possible to have just one email notification with an email script to achieve this? If so, could any of you please assist me in scripting.

Thank you in advance.

Regards

mmk

 

1 ACCEPTED SOLUTION

HI @Mi Mi type is a choice field, you can directly put the display value like below


    var gr = new GlideRecord("change_request");

    gr.addQuery("sys_id", current.sysapproval);

    gr.query();

    if (gr.next()) {
        if (gr.type == 'emergency')
            template.print('<p style="font-size:12px; color:red; font-family:arial">' + 'Emergency' + '<strong>');
        if (gr.type == 'normal')
            template.print('<p style="font-size:12px; color:orange; font-family:arial">' + 'Normal' + '<strong>');
        if (gr.type == 'expedited')
            template.print('<p style="font-size:12px; color:orange; font-family:arial">' + 'Expedited' + '<strong>');

    }
Regards
Harish

View solution in original post

5 REPLIES 5

Mi Mi
Tera Contributor

Hi @Harish KM 

Thank you so much. It works.

Regards

mmk