- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2015 09:06 AM
I created an inbound email action to create tasks (sc_task table) based on the subject of the email:
(function(){
var subject = email.subject.toLowerCase(); //convert the subject to lowercase just once
if (subject.indexOf("rds server restarts") >-1 || subject.indexOf("profiles cleaned") >-1) {
current.description = email.body_text;
current.short_description = email.subject.toString();
current.assignment_group.setDisplayValue("Service Desk");
current.insert();
event.state="stop_processing";
}
})();
The order of the inbound action is set to 10. The task gets created no problem, and the fields correctly filled in. However, it also creates an Incident still. The logs show it processes the 'Create Task' inbound action, as well as the 'Create Incident' inbound action. I put the 'event.state' code in, as that is what I have done previously on a Eureka instance, but the log file shows an error 'org.mozilla.javascript.EcmaError: "event" is not defined.'
I am sure I'm missing something simple. I just want to the task to be created and the action stopped, it does not need to go any further (no Incident needs to be created). Can anyone point me in the right direction? This is Fuji Patch2-hotfix 1 (developer instance).
Cheers,
Tim
Solved! Go to Solution.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2015 10:08 AM
just found this thread... https://community.servicenow.com/thread/181564
they say it should be fixed in fuji patch 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2015 09:50 AM
since both are running you are going to need someway to stop the incident one from running on those emails... the issue isn't in your new inbound action but in the existing one for incidents... i THOUGHT there was a checkbox for stop executing if one rule is applied but can't find it anywhere.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2015 09:54 AM
step 3 on this wiki site shows you how to stop the processing just be sure your new one executes first.
http://wiki.servicenow.com/index.php?title=Ordered_Email_Processing#gsc.tab=0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2015 10:05 AM
Thanks Doug. I have done those things already (ordered email and event.state), and it's not working. It's working on a Eureka instance, so it must be a bug in Fuji.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2015 10:08 AM
just found this thread... https://community.servicenow.com/thread/181564
they say it should be fixed in fuji patch 3