Trying to to update ticket with Out of Office replies but not create a new ticket
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2014 08:24 AM
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
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2019 07:37 AM
Curious if you got this to work and if so how? I would like the OoO to update the ticket but not create a loop once the update is sent.