RITM notification configuration

Priya V M
Tera Contributor

I have configured notification in which i have content to be added in notification and each of the notification has different content(around 12 notifications are configured RITM+SCTask) . I have also created template for RITM table and SCTask table and they have additional details like RITM/SCTask number, catalog item etc.
expectation is that when i preview the notification both the content added in notification along with the additional details added in the template to be visible.
Please let me know if that is possible to achieve.

7 REPLIES 7

Tried this solution did not work. Can you let me know exactly what to be done
i have added ${message} in template and also added content in the notification. this did not work

Ankur Bawiskar
Tera Patron
Tera Patron

@Priya V M 

to use same notification and have different content you need to use email script

In email script check the catalog item name and then accordingly change the email body

something like this

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

    // use this line if notification is on RITM table
    var itemName = current.cat_item.name;
    // use this line if notification is on SC Task table
    var itemName = current.request_item.cat_item.name;

    if (itemName == 'Your Item 1') {
        template.print('My Content 1');
    } else if (itemName == 'Your Item 2') {
        template.print('My Content 2');
    }


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

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Priya V M 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader