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

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

As always, thanks Maik for your response 🙂

I'll give it a try, and I'll respond to this thread asap.

Hi Amit

Did my reply answer your question?

If so, please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.

If not, please tell me what is still missing.

Kind regards
Maik

Hi Maik,

Pardon me for delayed response (I was away for some days), I'm marking your response as correct answer.

But few things I'd like check,

1. How to add email message of Question area in the email body of outbound notification when two or more Question area have been setup as out of office for the similar/overlapping period of time?
Because end users should know that till what date Question Area have been setup as OOO so that they can respond accordingly.

In following scenario, 3 Question Areas OOO overlapping

for example: 1. Question Area ABC OOO setup from 21 Dec - 31 Dec
                   
2. Question Area XYZ OOO setup from 24 Dec - 3 Jan
                   
3.  Question Area MNO OOO setup from 25 Dec - 4 Jan

Email message of Question Area ABC is "We are out of office from 21 Dec - 31 Dec"
Email message of Question Area XYZ is "We are out of office from 24 Dec - 3 Jan"
Email message of Question Area MNO is "We are out of office from 25 Dec - 4 Jan"

find_real_file.png

2. Do we need each notification for each Question Area? 

Please guide here.         

Hi Amit,

I think you will only one otubound notification und within the body you call a email script that

  1. collects all relating Question Areas and
  2. generates the HTML output for the email body (in your example a list with three items)

Please see https://docs.servicenow.com/bundle/paris-servicenow-platform/page/script/server-scripting/concept/c_... for more information.

Kind regards
Maik