Parsing a calendar invite with SmartHandler

Calendar invites can now easily be parsed and used in your Jira ticket fields using SmartHandler. Below we will look at the incoming .ics file contents and how to use the start/end times in a custom field in Jira.


This is an example of an .ics file that contains your calendar invite. The contents are straight forward and can be easily parsed using some simple regexes as seen below in the following step-by-step tutorial. 

BEGIN:VCALENDAR
METHOD:REQUEST
PRODID:Microsoft Exchange Server 2010
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Pacific Standard Time
BEGIN:STANDARD
DTSTART:16010101T020000
TZOFFSETFROM:-0700
TZOFFSETTO:-0800
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
TZOFFSETFROM:-0800
TZOFFSETTO:-0700
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
ORGANIZER:MAILTO:Kara.MacLachlan@Forty8Fiftylabs.com
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE:MAILTO:f8flabs.qa@forty8fiftylabs.com
DESCRIPTION;LANGUAGE=en-US:\n\n
SUMMARY;LANGUAGE=en-US:test meeting
DTSTART;TZID=Pacific Standard Time:20190130T123000
DTEND;TZID=Pacific Standard Time:20190130T130000
UID:040000008200E00074C5B7101A82E00658900000E023DF3896B8D401000000000000000
 0100000009A0B17A39C698646887AA9DA2C3B306F
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20190130T202104Z
TRANSP:OPAQUE
STATUS:CONFIRMED
SEQUENCE:0
LOCATION;LANGUAGE=en-US:test location
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:0
X-MICROSOFT-DISALLOW-COUNTER:FALSE
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:REMINDER
TRIGGER;RELATED=START:-PT15M
END:VALARM
END:VEVENT
END:VCALENDAR




Step 1. Create two new data points that will hold your meeting start and end times. 

Our start time is defined on this line: DTSTART;TZID=Pacific Standard Time:20190130T123000.

The regex below in the RegEx box finds this entire line. Then once found, our nested regex applies another regex to just get the timezone, date, and time. You'll notice the incoming format of the date and time are not typically going to be the format used in Jira. This means we will need to convert it to a useable format. Checking the box, Is this a date or time, will allow us to define the incoming format. Using Java date format, we can identity this as our format "zzzz:yyyyMMdd'T'HHmmss". More information about this formatting can be found here. The next dropdown is optional. If you want to change the incoming timezone before you assign this date to a ticket, you can use this drop down menu to select a new timezone conversion. Otherwise, SmartHandler will use the incoming timezone.

The same can be done for the meeting end Data Point. This time we will look at line DTEND;TZID=Pacific Standard Time:20190130T130000.  The only difference for this one is our initial RegEx.

Meeting Start initial regex
DTSTART;TZID.\s*.*
Meeting End initial regex
DTEND;TZID.\s*.*
Nested regex for both
(?<=\=).*
Date Time format
zzzz:yyyyMMdd'T'HHmmss


Meeting Start Data Point


Meeting End Data Point



Step 2. Use your data points

Once your Data Points are defined, you will be able to use these in text or date fields. In this example, I have created to custom Date Time Picker fields called Meeting End and Meeting Start.


Field Mapping