Create Task from Inbound Email

Community Alums
Not applicable

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

1 ACCEPTED SOLUTION

just found this thread... https://community.servicenow.com/thread/181564



they say it should be fixed in fuji patch 3


View solution in original post

5 REPLIES 5

Community Alums
Not applicable

Thanks Doug!