Trying to to update ticket with Out of Office replies but not create a new ticket

germc
Giga Expert

Hi folks,

We have a rule in the Mail Settings where any email wth the subject line containing:   "AUTO:" or 'out of office' will be ignored.   This is to prevent new tickets being automatically created by an out office. However, if we are updating an Incident for an end-user, we would want to know if they are out of the office, therefore we would want that Out of Office response to come in to ServiceNow and update their Incident. We dont want the out of offices to create new incidents (which is why we have them set to be ignored) However, we would like them to update tickets if its a response to a notification.

Ive done a lot of work on this and updated the Inbound action 'Update Incident (BP)':

I added the following:

if (email.subject.toLowerCase().indexOf("out of the office") >= 0) {

          current.incident_state = "2";

          current.work_notes = "This user is out of the office";

}

That did not work so I commented it out and created a new inbound action called 'out of office update'

 

gs.include('validators');

if (current.getTableName() == "incident") {
  current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;

    if (email.subject.toLowerCase().indexOf("out of the office") >= 0) {
          current.work_notes = "This user is out of the office";
}

 
  current.update();
}

 

However, Im not sure to set the 'Type' as New or Reply.. I have tried both but it does not work.

Would anyone know what 'Type' would an out of office fall under or if Im close with the script above?

Thanks a million

10 REPLIES 10

Hi,


Unfortunately I have not found a solution for this one.


We have decided to park it for now and concentrate on other functionality..


If we revisit this in future I will definately post an answer.


Thanks


Robert Chrystie
ServiceNow Employee
ServiceNow Employee

Sorry,



I get an error when I try to post my full response for some reason...please see the screenshot for more detail.



Post.PNG



Here is the error I got...


Error Message.PNG



-Robert


Hello Robert,



Thanks for the information.



In your organization servicenow instance, OOO auto replies are getting properly updated to the ticket?


This is not a feature that my organization requires.   Instead we do not want to note OOO auto replies into our tickets and as such have added the text that our exchange system uses to the list of ignored subject lines.



Thanks,


-Robert


Thank you for sharing Robert! I will pass on your issue posting with our community team