logo

NJP

How to send events from servicenow to google calendar

Import · Apr 24, 2019 · article

Dear All, In this section I will describe how we can send event notification from Service-now calendar (user_calendar_event) to Gmail Calendar (your personal Gmail account).

First, in the System navigation type 'my calendar' then you will find your service-now calendar under the Self-service module: you can create some events for testing. All those events are stored in the service-now table: user_calendar_event

image

We start by creating Events to trigger the creation or updating or deleting the events in service-now:

1 - Go to system policy -> Events -> Registry and click new:

We create the first event that will trigger when an event is created in our service-now calendar,

image

2- Click on the related link and create a business Rule to capture that event when triggered.

The business rule will run after insert only, on the advanced script copy the script below:

if (current.operation() == 'insert') { gs.eventQueue("user_calendar_event.inserted", current, gs.getUserID(), gs.getUserName()); }

The business rule will be like:

imageimage

3- We create a notification for that event:

In the when to send part we have to specify: event is fired and we select our event from the list as below:

imageimage

We can also specify who will receive, we can select both: Event parm 1 contains recipient and Send to event creator

And finally what it will contain, the best practice is to use a template with a content type: HTML and plain text:

Below the content of the template notification:

BEGIN:VCALENDAR RODID:-//Google Inc//Google Calendar 70.9054//EN VERSION:2.0 CALSCALE:GREGORIAN METHOD:PUBLISH X-WR-CALNAME:Art Yourself Classes X-WR-TIMEZONE:Europe/Paris X-WR-CALDESC:Sign up here to take Art Classes @ Art Yourself w/Virginia LaM ont Naegeli X-WR-TIMEZONE:Europe/Paris BEGIN:VEVENT ATTENDEE;ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:${user.email} ORGANIZER:MAILTO:dev42863@servicenowdevelopers.com LOCATION:Hangout meeting DTSTART:${start_date_time} DTEND:${end_date_time} UID:${sys_id} DTSTAMP:${dtstamp} STATUS:CONFIRMED DESCRIPTION:test from servicenow SUMMARY:subject line END:VEVENT END:VCALENDAR
View original source

https://www.servicenow.com/community/csm-articles/how-to-send-events-from-servicenow-to-google-calendar/ta-p/2298670