Auto Populating CAB Meeting Agendas

Eitan Salita
Tera Expert

Hello guys,

Is there any OOB/customized option to auto populate the agenda items instead of using "refresh agenda items" UI Action each time?

Thanks in advance,

Eitan

1 ACCEPTED SOLUTION

ginesdoleratorm
ServiceNow Employee
ServiceNow Employee

Hi Eitan,



There is no OOB option for that, but it needs to be manually triggered using the "refresh agenda items" UI Action, or you would need to customize your business rules.


You can use the method refreshChangeAgendaItems() within the CABMeeting API to generate the agenda items programatically. That is, you can modify existing UI actions or create a business rule to also refresh the agenda items when a new cab meeting is generated.


For example, "Refresh CAB Meetings" UI action can be modified as follow, to refresh the agenda items.



current.update();


new CABDefinition(current).refreshMeetings();



// refresh agenda items


var cabMeetingGr = new GlideRecord(CAB.MEETING);


cabMeetingGr.addActiveQuery();


cabMeetingGr.addQuery(CAB.DEFINITION, current.getUniqueValue());


cabMeetingGr.query();


while (cabMeetingGr.next()) {


        var cabMeeting = new sn_change_cab.CABMeeting(cabMeetingGr);


        cabMeeting.refreshChangeAgendaItems();


}



action.setRedirectURL(current);


View solution in original post

7 REPLIES 7

Hi @Steve McCluske1

I have tried to create a schedule job as above and working. However, mails are not getting triggered to attendee's. Could you please provide any info for triggering emails as well.

Here you go. Give this a shot. If it works, please mark helpful.

var encQuery = 'startONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()^active=true';
var grMeeting = new GlideRecord('cab_meeting');
var now = new GlideDateTime();
grMeeting.addEncodedQuery(encQuery);
grMeeting.query();

while (grMeeting.next()) {
    if (grMeeting.getRowCount() == 1) {
        var cabAgendaClass = new sn_change_cab.CABMeeting(grMeeting);
        cabAgendaClass.refreshChangeAgendaItems();
        cabAgendaClass.createCABAttendeeNotifyEvents(now) // added to send out notifications
        gs.info('This scheduled job was successful');
    } else {
        gs.error('The Scheduled Job failed for Automate CAB Refresh Agenda Items');
    }
}

Latest Code worked and triggering emails as well. Thanks for the help Steve.