NotifyNow - initiateConferenceCall(String[] conferenceCallParticipants, String conferenceCallTitle, GlideRecord sourceRecord, Boolean private)

  • Release version: Washingtondc
  • Updated February 1, 2024
  • 1 minute to read
  • Initiate a new conference call.

    Table 1. Parameters
    Name Type Description
    conferenceCallParticipants String One or more users, conference call participants, identified by the sys_ids from the sys_user table or E.164-compliant phone numbers.
    conferenceCallTitle String Title of the conference call. This parameter has a maximum length of 40 characters.
    sourceRecord GlideRecord Source record to associate to the conference call such as an incident or problem number.
    private Boolean Value to control if a conference call is private. This value defaults to false.
    Table 2. Returns
    Type Description
    GlideRecord The conference call record, or null if there was an error.

    This initiates a conference call with participants that have a E.164-compliant phone number and participants from the sys_user table and sends conference call details via SMS and email to all participants.

    // define phone number participants
    var participants = ['+31205655548', '+31205655552', '+31652825393'];
     
    // we also want to add two Dutch sys_user participants
    var user = new GlideRecord('sys_user');
    user.addNotNullQuery('mobile_phone');
    user.addQuery('mobile_phone', 'STARTSWITH', '+316');
    user.setLimit(2);
    user.query();
     
    // add users to the participant array
    while (user.hasNext() && user.next()) {
    	gs.log('adding user ' + user.getValue('name') + ' with phone number ' + 
                 user.getValue('mobile_phone') + ' to the participant array');
    	participants.push(user.getUniqueValue());
    }
     
    // define a source record to associate with the conference call
    var source = new GlideRecord("cmdb_ci");
    source.query("asset_tag", "P1000167");
    if (source.hasNext() && source.next()) {
    	// set up conference call
    	var nn = new SNC.NotifyNow();
    	var conferenceCall = nn.initiateConferenceCall(participants, "testing 1 2", source);
     
    	// check if the conference call was successfully created
    	if (conferenceCall != null) {
    		gs.log('started conference call: ' + conferenceCall.getUniqueValue());
    	} else {
    		gs.log('could not start the conference call :(');
    	}
    }