
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2024 10:52 AM - edited 09-25-2024 10:54 AM
Hey All,
I hope all is well. I have a quick question. How can I create a hyperlink inside the iCal?
Here is the code:
(function executeRule(current, previous /*null when async*/) {
// -----------------------------------------------
// If already has iCal file, delete old one first
// -----------------------------------------------
var gsa = new GlideSysAttachment();
var agr = gsa.getAttachments(current.getTableName(), current.sys_id);
if (agr.next())
gsa.deleteAttachment(agr.getValue("sys_id"));
// -----------------------------------------------
// Create iCal content string
// -----------------------------------------------
var iCalString = "";
iCalString += "BEGIN:VCALENDAR\n";
iCalString += "[PROD ID OF OUR INSTANCE]";
iCalString += "VERSION:2.0\n";
iCalString += "METHOD:REQUEST\n";
iCalString += "BEGIN:VEVENT\n";
iCalString += "ATTENDEE;ROLE=REQ-PARTICIPANT;RSVP=FALSE:MAILTO:" + current.contact.email + "\n";
iCalString += "ORGANIZER:" + "example.gov\n";
iCalString += "DTSTART:" + formatDateTime(current.window_start) + "\n";
iCalString += "DTEND:" + formatDateTime(current.window_end) + "\n";
iCalString += "UID:" + gs.generateGUID() + "\n";
iCalString += "DTSTAMP:" + formatDateTime(current.sys_created_on) + "\n";
iCalString += "DESCRIPTION:" + "Please proceed to check-in for your IT Customer Care Center: "+ current.short_description + ". If you can't make your appointment, you can " + "[code] <a href='https://example.gov/esc?id=walkup_visits'>" +"reschedule or cancel it." + "</a>[/code]" + "\n";
iCalString += "SUMMARY: IT Customer Care Center\n";
iCalString += "LOCATION:" + current.wu_location_queue.name + "\n";
iCalString += "END:VEVENT\n";
iCalString += "END:VCALENDAR\n";
// -----------------------------------------------
// Write iCal file to appointment record
// -----------------------------------------------
var attachment = new GlideSysAttachment();
attachment.write(current, "wu_appt.ics", "text/calendar", iCalString);
/**
* Formats Date/Time field into iCal-compatible string
*/
function formatDateTime(dt) {
var iCalDateTime = dt + "";
iCalDateTime = iCalDateTime.replace(/[-:]/g, "");
iCalDateTime = iCalDateTime.replace(/\s/g, "T");
iCalDateTime += "Z";
return iCalDateTime;
}
})(current, previous);
When I download the iCal from the portal it displays this.
It isn't populating the URL. I feel like I am missing something. What am I missing in the code?
It should look like this: "If you can’t make your appointment, you can reschedule or cancel it."
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2024 05:42 AM
Here is the solution if anyone wants to know. You will use "X-ALT-DESC;FMTTYPE=text/html:"
Here is the link: https://blog.worldline.tech/2023/06/20/html-icalendar.html

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2024 05:42 AM
Here is the solution if anyone wants to know. You will use "X-ALT-DESC;FMTTYPE=text/html:"
Here is the link: https://blog.worldline.tech/2023/06/20/html-icalendar.html