Include meet link in the icalendar invite
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2025 12:48 AM - edited 06-26-2025 12:58 AM
We need to include the meeting link in the icalendar invitation.
We have created the script include as below, for the icalendar invite and then called it the email script which is refered in the email notification:
var ICS_SNOW_AttachmentGenerator = Class.create();
ICS_SNOW_AttachmentGenerator.prototype = {
initialize: function() {},
_formatDate: function(dateunformatted) {
var formDate = dateunformatted + "";
formDate = formDate.replace(/\-/g, "");
formDate = formDate.replace(/\s+/g, "T");
formDate = formDate.replace(/\-/g, "");
formDate = formDate + "Z";
return formDate;
},
/*
GRObj is the GlideRecord Object of the record in my custom table containing the details of the meeting.
*/
payloadGen: function(GRObj) {
var startDate = this._formatDate(GRObj.u_scheduled_date_time);
var addend = new GlideDateTime(GRObj.u_scheduled_date_time);
var hours = 60 * 60 * 1;
addend.addSeconds(hours);
var endDate = this._formatDate(addend);
var payload = "";
payload += "BEGIN:VCALENDAR\r\n";
payload += "VERSION:2.0\r\n";
payload += "PRODID:-//Service-now.com//Outlook 11.0 MIMEDIR//EN\r\n";
payload += "METHOD:REQUEST\r\n";
payload += "BEGIN:VEVENT\r\n";
var taskuser = GRObj.assigned_to.email;
var assetuser = GRObj.u_asset_assigned_to.email;
var useremails = [];
useremails.push(taskuser + '');
useremails.push(assetuser + '');
var attendees_list = useremails.toString().split(',');
if (attendees_list.length > 0) {
for (var i = 0; i < attendees_list.length; i++) {
payload += "ATTENDEE;ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:" + attendees_list[i] + "\r\n";
}
}
payload += "ORGANIZER:MAILTO:taskuser" + "\r\n"; // The ORGANISER tag is generally used to override the email address where the responses will be send, when replied by the attendees for the invites received by them. Moreover, if the value of ORGANISER tag is set then the recipients will receive mails fromm the value mentioned in the organizer tag.
payload += "DTSTART:" + startDate + "\r\n";
payload += "DTEND:" + endDate + "\r\n";
//payload += "LOCATION:Meet" + "\r\n"; // you can use variable, if you are maintaining VRooms for your meetings;
payload += "TRANSP:OPAQUE" + "\r\n";
payload += "UID:" + new GlideEmailWatermark().optionallyRandomize(GRObj.number) + "\r\n";
payload += "DTSTAMP:" + this._formatDate(new GlideDateTime().getValue()) + "\r\n";
payload += "DESCRIPTION:You are requested to join the meeting" + "\r\n"; //provide your own mwssage or populate using variables.
payload += "SUMMARY:Meeting Invite\r\n";
payload += "PRIORITY:5\r\n"; // can take values from 0 to 9 "0 to 4 HIGH Priority, 5 MODERATE PRIORITY, 6 to 10 LOW PRIORITY".
payload += "X-MICROSOFT-CDO-IMPORTANCE:1\r\n"; //can take values from 0 to 2. Specifies the importance of an appointment.
payload += "CLASS:PUBLIC\r\n";
payload += "BEGIN:VALARM\r\n";
var alarm_time = 10;
payload += "TRIGGER:-PT" + alarm_time + "M\r\n"; // The TRIGGER take values in MINUTES and the VALARM EEVENT triggers a reminder message on the recipients screen 10 minutes before meeting start.
payload += "ACTION:DISPLAY\r\n";
payload += "END:VEVENT\r\nEND:VCALENDAR\r\n";
var gAttach = new GlideSysAttachment();
gAttach.write(GRObj, "Meeting_Invite[" + new GlideDateTime().getValue() + "].ics", 'text/calendar', payload);
},
type: 'ICS_SNOW_AttachmentGenerator'
};
We are receiving the invites as below also it is updating the invite in the calendar but to join the meeting there is no meet link generated dynamically:
How can we generate the meet link (outlook meeting link) dynamically while sending the icalendar invite?
If anyone has any insights to share, your help would be greatly appreciated.
0 REPLIES 0