Issue sending "Meeting Invitation" from ServiceNow - Change

jimnicholson
Giga Guru

Hello Community

Still relatively new to SNow (I'll play this card for the next few years if I can), and have run across something that has really stumped me and I can't for the life of me figure it out.

We have a mandatory call for every change that goes through, to review change records for that day and the submitter needs to attend and let everyone know that they are ready to deploy the change.   The call happens the day of the change at 8:30 AM.   I created two new fields on the change form (u_ipcm_call_scheduled and u_ipcm_call_end)   I then have an business rule that runs when the state changes to "IPCM Review" to populate these two fields. This business rule basically grabs the start date of the change, and then splits the date and time, uses the date portion along with statically setting the time to 8:30 and 9:00 of the scheduled change date for call start and end time.

Here is the script the Business Rule is running:

function onBefore(current, previous) {

       

            var dateSection = current.start_date.split(' ')[0]; //Gets the Date

            var timeSection = current.start_date.split(' ')[1]; //Gets the Time

         

//Set the value of the Date field with the date from the Date/Time field

 

  var gdt1 = new GlideDateTime(dateSection + ' 08:30:00 AM');

  var gdt2 = new GlideDateTime(dateSection + ' 09:00:00 AM');

  current.u_ipcm_call_scheduled = gdt1;

  current.u_ipcm_call_end = gdt2;

}

So the field(s) appear to be populating properly, the date/time format looks good.   The notifications are triggered just fine, and the meeting invite has everything in the proper locations (location, start time / end time, etc...)

The issue I am having, is lets say the fields populated for 01/07/2015 08:30:00 AM and the end is 01/07/2015 09:00:00 AM, when I receive the meeting invite, the start and end times are exactly the same, and the times are not what is in the fields I populate.   For the example above, I'll receive a meeting invite for a start and end time of like 11:27 AM or some odd random time, and my invite says "This was created in a different time zone, the times have been adjusted"

I have tried shutting off the "Append timezone to dates and times in sent mail" setting in email properties, this didn't make a difference.   My time zone setting at the system level under system properties -->general are set to US\Eastern, which is correct for where I am.   I'm at a loss here, I suspect it may be related to how I am putting the time element in the two gdt variables, but I'm not sure.

Any help would be greatly appreciated.

Thank you,

Jim

1 ACCEPTED SOLUTION

jimnicholson
Giga Guru

Hi All,



Update from ServiceNow Support.   This is apparently a known issue, PRB614409.   I deactivated the OOB map and created a custom one, but regardless of the active flag, the system is still processing using the original OOB map.   Looks like the workaround, if you have a custom map where one already exists OOB, is either to edit the OOB map to your liking, OR, delete the out of the box one.   I am in the process of testing this right now, I'll follow up with my testing results.




Hello Jim,



I apologize for the delay in getting back to you.



This is a known problem and I have associated the problem with this


incident, PRB614409.



I confirmed this as follows:I created a new change request, CHG0030778 on the dev instance



There are 2 sys_impex_map for icalendar.change_request



You have deactivated the default out of the box one, which has the following mappings:start_date dtstartend_date dtend



If you look at the notification that got triggered



The Calendar invite in the notification has:DTSTART:20160122T004959Z DTEND:20160123T005003Z



which correspond to the start_date and the end_date of the Change,


CHG0030778:<start_date>2016-01-22 00:49:59</start_date><end_date>2016-01-23 00:50:03</end_date>



So the system was looking for the first impex map it could find for


icalendar and using that one even though it is de-activated . So every time it


was grabbing the field map that was set in the out-of-box version and ignoring


your custom one.



Some workarounds you may want to do to adjust for this: - You might want to edit the field maps on the out of box impex map.- or you may want to just *delete* the out of box impex map   if you know you won't use it.



I will go ahead and Solution Propose the incident. Please test and


confirm after implementing either of the workarounds.




					
				
			
			
				
			
			
				
			
			
				

View solution in original post

12 REPLIES 12

jimnicholson
Giga Guru

Scratch the script I posted earlier, I was looking at a previous version, sorry for the confusion.   This is my BR script:



function onBefore(current, previous) {


          //If the new value isn't blank


            var dateSection = current.start_date.split(' ')[0]; //Gets the Date


            var timeSection = current.start_date.split(' ')[1]; //Gets the Time


            //Set the value of the Date field with the date from the Date/Time field


  current.u_ipcm_call_scheduled = dateSection + ' 08:30:00 AM';


  current.u_ipcm_call_end = dateSection + ' 09:00:00 AM';


       


    }


donnie5
Mega Expert

If the start and end times are the same and don't have a value you expect, I would double-check the iCalendar Import Export settings for change_request.



Since you say you're new:


  • In the Application Navigator, type "sys_impex_map.list"
  • In the Import Export list view, filter for Name = "icalendar.change_request" or filter for Type = "iCalendar".
  • Open the icalendar.change_request record.
  • In the Field Maps related list:
    • Verify that the one for dtstart is u_ipcm_call_scheduled.
    • Verify that the one for dtend is u_ipcm_call_end.


The "time zone" issue is interesting. I would look at the iCalendar message that SNOW sent by looking for it in SNOW's Sent mailbox. At least there you can see how SNOW specified the time zone and see if it's a different one from your Outlook time zone. Or something like that.


Also, if the dates are the same, make sure the template says:



DTSTART:${dtstart}
DTEND:${dtend}



...make sure they haven't both been set to dtstart or dtend. Or, also, that they're not anything else but those two values.


Thanks Donnie,



So I do have those fields mapped in the import export:



find_real_file.png



here is the template:



BEGIN:VCALENDAR


PRODID:-//Service-now.com//Outlook 11.0 MIMEDIR//EN


VERSION:2.0


METHOD:REQUEST


BEGIN:VEVENT


ATTENDEE;ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:${to}


ORGANIZER:MAILTO:${from}


DTSTART:${dtstart}


DTEND:${dtend}


LOCATION: call in number /   access code


TRANSP:OPAQUE


SEQUENCE:${sys_mod_count}


UID:${number}


DESCRIPTION:IPCM Daily Review


SUMMARY:${summary}


PRIORITY:3


X-MICROSOFT-CDO-IMPORTANCE:${priority}


STATUS:CONFIRMED


CLASS:PUBLIC


END:VEVENT


END:VCALENDAR



So I have one change that I just ran this on, the dates are populated as follows:



find_real_file.png



here is my invite I received (showing rescsheduled because I've already sent an invite out on this change):


find_real_file.png



This is so bizarre.