- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2017 03:44 AM
Hi all,
When we first implemented ServiceNow we were under the impression that when an incident goes from a Resolved state to Closed it could no longer be re-opened by the users clicking the link that emails the instance with a subject of "please reopen". It turns out this isn't the case though as we've had incidents that have been resolved for about 5 months being re-opened. What would I change in the script to stop this happening and only re-open stuff that is set as resolved.
Currently looking at the inbound email action "Update Incident (BP)", looking at the code I think I need to add something into the section "if (email.subject.toLowerCase().indexOf("please reopen") >= 0) {" but I'm not sure what I should be adding there to change the functionality. Complete code posted below...
gs.include('validators');
if (current.getTableName() == "incident") {
current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
if (email.subject.toLowerCase().indexOf("please reopen") >= 0) {
current.state = "2";
current.work_notes = "The caller did not feel that this issue was resolved";
}
if (gs.hasRole("itil")) {
if (email.body.assign != undefined)
current.assigned_to = email.body.assign;
if (email.body.priority != undefined && isNumeric(email.body.priority))
current.priority = email.body.priority;
}
current.update();
}
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2017 03:46 AM
Hi James,
You can add these lines and test it out once
if (email.subject.toLowerCase().indexOf("please reopen") >= 0 && current.state !=3 ) {
current.state = "2";
current.work_notes = "The caller did not feel that this issue was resolved";
}
Thank You
Please Hit Like, Helpful or Correct depending on the impact of response

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2024 10:00 AM
I finally resolved the issue with this inbound action. Dylan Hutchens (My manager) reviewed the inbound action and helped me with gs.log to determine if the inbound action was even running. It was not. I reviewed the ServiceNow Documentation Specifying the inbound email processing order which is very clear but found in the Developer > Notifications: Creating Inbound Email Actions | ServiceNow Developers to be inciteful too as it provides some very useful information regarding the following:
This info message: NOTE: If the Conditions or Condition field have no value, the fields return true. Both fields must return true for the Inbound Action to execute.
Execution Order: Order of execution of Inbound Actions for records meeting the trigger criteria. Lowest numbers execute first.
Here's a refined summary of the solution:
The **"Update Incident (BP)"** inbound email action wasn’t reopening incidents in a resolved state because it was not executing. The root cause was its **execution order set to 100**, which matched another inbound action, creating an unpredictable execution sequence. This action specifically requires the **subject line to contain "please reopen"** when replying. After adjusting the execution order from **100 to 99**, this action now runs first, successfully processing replies and reopening incidents by setting their state to **In Progress**.