- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2022 06:57 AM
I am trying to send a notification to a user the replies to a closed incident. I've been reading a lot of threads and finally though I got it figured out, but the reply is not sending. Would love another set of eyes to see if they can spot what I might have done wrong?
I'm using an inbound email action, an event, and a notification.
Before I start, I also edited the "Update Incident (BP)" inbound action to prevent the inbound reply from adding a comment to the incident if it's closed by adding an if statement for gr.state != 7. The full code for that inbound action is below. However, in spite of this, the reply from the user is still added as a comment on the incident.
gs.include('validators');
if (current.getTableName() == "incident") {
var gr = current;
if (email.subject.toLowerCase().indexOf("please reopen") >= 0)
gr = new Incident().reopen(gr, email) || gr;
if (gr.state != 7) {
gr.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
}
if (gs.hasRole("itil")) {
if (email.body.assign != undefined)
gr.assigned_to = email.body.assign;
if (email.body.priority != undefined && isNumeric(email.body.priority))
gr.priority = email.body.priority;
}
gr.update();
}
I used this thread as a guide for the solution I am trying: https://community.servicenow.com/community?id=community_question&sys_id=c507f3c11be98098ada243f6fe4bcbd5
Inbound Email Action
Event
Notification
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2022 07:08 AM
The solution to my issue ended up being as simple as checking the "send to event creator" tickbox in the notification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2022 07:07 AM
Hi staxed
what is the issue you are facing?
is your new inbound action not getting triggered? Did you keep logs in your inbound action and verified?
You can verify which inbound action is triggered for the received email using below approach
1. Open the received email record from 'sys_email' table
2. Scroll down to email log related list and check which inbound action is triggered in Message column.
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2022 07:15 AM
It looks like the inbound action is running, but the system never sent the response notification.
From the email log:
Stop processing detected after executing script: Incident Closed Autoreply |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2022 10:55 PM
keep logs in your Incident Closed Autoreply inbound action script and check the values.
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2022 07:08 AM
The solution to my issue ended up being as simple as checking the "send to event creator" tickbox in the notification.