Seeking advice on setting up Out of Office (like Outlook) in ServiceNow

Amit Rao
Giga Expert

Hello Experts,
We've been asked to setup Out of Office functionality (like Outlook) in ServieNow when Question area's field Out of Office ticked then ServiceNow should add the OOO message to the notification body. So, caller will know that there will be a delay in response.

Here is our Ticket form when someone sends an email this type of Ticket get created. (by inbound action, ignore the caller field)

find_real_file.png

You can see in the above form there is field named Question Areathat record having Out of Office (checkbox) field as following, (please assume Question Area name is Kolding - Orders)

find_real_file.png

 

Now, here is the tricky part comes, there are several Question Areas (around 30), there is always ticket get created with different Question Area. Now we need to setup in such a way that when Owner ticked specific Question Area's Out of Office field and put the date in Starts and Ends along with Email message, then during mentioned date range Email message should be added to the notification body. And when current date reaches/equals to Ends date, then automatically Out of Office field get unticked and there will be no Email message added to the notification body. We have notification like Ticket creation(trigger when new Ticket get created)

Our logic should check for those ticket's which is having Question Area's field Out of Office ticked, if it does then it should work as mentioned above.

I was thinking

  • Do I need to create notification for each Question Area? (because the Email message could be different for each Question Area)
  • If I don't need to create several notifications then what happen when more than 1 Question area's have been setup as Out of office?
  • Will mail script add the Email message in notification body?
  • How will I calculate the date range? (because notifications should be triggered only during mentioned date range)
  • As soon as Ends date over then, will schedule job make Question Area's field Out of Office automatically get uncheck? (if it does then it should run daily, correct?)

I'd like to hear from you guys what would be your approach to setup this.
Please suggest, thanks.

1 ACCEPTED SOLUTION

Hi Amit,

I think the following extensions have to be done:

Event Registry:

In your Inbound Email Action:

  • Check whether the Question Area record has checked "Out of office".
  • If so trigger an event with
    • Event Name = "question.autoresponder"
    • Glide Record Object = current
    • parm1 = Caller's email address
    • parm2 = <whatever you want to add>

Outbound Notification:

  • Create an Outbound Notification with
    • Send when = "Event is fired"
    • Event name = "question.autoresponder"
    • Event parm 1 contains recipient = checked
    • What it will contain = <create the email to caller>

Scheduled Script:

  • Create a new Scheduled Script
  • it should run once a day
  • it iterates all Question Area records an checks
    • whether "Start date" is reached or over and "Out of Office" is not checked 
      • if so, check "Out of Office" and update
    • whether "End date" is reached or over and "Out of Office" is checked
      • if so, uncheck "Out of Office" and update

View solution in original post

9 REPLIES 9

Pranesh072
Mega Sage
Mega Sage

Looks like a nice idea, I tried to understand the Question Area Scenario.

According to my understanding you need to create only one mail script, in which you can dynamically fetch the question area details and also checks the out of office condition. it will be easy of maintain. This covers first 3 questions.

 

How will I calculate the date range?

You dont need to. In your mail script you can check using "out of office" checkbox, if its true, include the message and if dont, then dont include the message.

 

As soon as Ends date over then, will schedule job make Question Area's field Out of Office automatically get uncheck

If you have only date then you can create a scheduled job which can run after midnight and update the checkbox according to enddate field.

In another scenario, if you may have date time field then scheduled job approach will not work. In that case you can use "gs.eventQueueScheduled" which will fire an event with some delay(in this case it will be the endtime) and use script action to update the out of office checkbox.

 

let me know if you need any suggestions

 

 

 

 

 

  

Thanks Pranesh, for your advice.
One question regarding adding email message in notification body via mail script.
We got notification Ticket Creation where we need to add email message in the notification body, I'd like to know what happen when two Question Areas have been setup out of office checked.
2 different email message (from 2 Question Area) and one email notification.
How will our logic handles this situation?

I'm little confused. can you give some examples and screenshots. What notifications you have how do you trigger them..

Amit Rao
Giga Expert

Hi @Maik Skoddow 

Any thoughts on this?