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

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);


Great , thank you for the information !


Steve McCluske1
ServiceNow Employee
ServiceNow Employee

I'd also like to share the code I wrote for a customer. Hope this additionally helps someone.

 

Solution: Create a Scheduled Job to kick-off this script a few hours before the schedule CAB meeting each week. 

 

Use Case: Customer was wanting to automate clicking Refresh the Agenda Items a few hours before actual meeting so when they get into the Meeting record all the items in there are accurate up to a few hours before. 

 

find_real_file.png

 

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

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

Seeing would adding 

refreshAgendaItemsAndEmail also send an email?