CAB Meeting: Adding Agenda Items to the, "CAB board member meeting invitation" Notification

Hussain Marakar
Tera Contributor

Currently the OOB notification, CAB board member meeting invitation, does not contain or include the agenda items,

HussainMarakar_0-1770876768182.png
What are the possible ways to add this to the above mentioned notification?
Is there any OOB way or any email script is required? and how?

2 REPLIES 2

Dr Atul G- LNG
Tera Patron

Hi @Hussain Marakar 

 

A robust logic is required since the CAB agenda may contain multiple changes assigned to either one person or different individuals. You will need to develop an email script that executes on the CAB Agenda table, fetches the agenda, retrieves all changes for the respective assignees, and sends the corresponding emails.

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

Hussain Marakar
Tera Contributor

Email script to achieve this:

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

    // Add your code here
    //if (current.getTableName() != CAB.AGENDA_ITEM)
    //  return;

    var meetingId = current.cab_meeting;

    var agendaGR = new GlideRecord('cab_agenda_item');
    agendaGR.addQuery('cab_meeting', meetingId);
    agendaGR.orderBy('order');
    agendaGR.query();

    if (!agendaGR.hasNext()) {
        template.print("No Agenda items specified for this CAB Meeting.<br/><br/>");
    } else {
        template.print("The following Changes are the Agenda Items Planned for this CAB Meeting:<br/><br/>");
        //template.print("<html><body>");
        template.print("<table border='1' cellpadding='5' cellspacing='0' style='border-collapse: collapse;'>");

        template.print("<tr>");
        template.print("<th style='text-align:center;'>Change Number</th>");
        template.print("<th style='text-align:center;'>Short Description</th>");
        template.print("<th style='text-align:center;'>Assignment Group</th>");
        template.print("<th style='text-align:center;'>Assigned To</th>");
        template.print("<th style='text-align:center;'>Service-Application</th>");
        template.print("<th style='text-align:center;'>Environment</th>");
        template.print("</tr>");


        while (agendaGR.next()) {
            if (!agendaGR.task.nil()) {

                template.print("<tr>");
                template.print("<td>" + agendaGR.task.getDisplayValue() + "</td>");
                template.print("<td>" + agendaGR.task.short_description.getDisplayValue() + "</td>");
                template.print("<td>" + agendaGR.task.assignment_group.getDisplayValue() + "</td>");
                template.print("<td>" + agendaGR.task.assigned_to.getDisplayValue() + "</td>");
                template.print("<td>" + agendaGR.task.business_service.getDisplayValue() + "</td>");
                template.print("<td>" + agendaGR.task.u_environment.getDisplayValue() + "</td>");
                template.print("<tr/>");
            }
        }
        template.print("</table>");
        //template.print("</body></html>");
    }


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


Note: Preview will show with Tags, as the notification type is meeting invite (if calling email script in meeting invite)