a) A new email arrived to the instance, however no new incident was created.   The email record's log section shows that the Inbound action was fired but no record was created or updated:

  • Skipping 'Create Incident', did not create or update Incident.
  • Stop processing detected after executing script: Create Incident.


b) The Node log files shows that the inbound action script finish with an error like this one:

*** WARNING ***Evaluator: org.mozilla.javascript.EcmaError: "mylookup" is not defined. 
Caused by error in sysevent_in_email_action.aff0ada71c540100db369016842fd3ab.script at line 25



The inbound action script failed to execute due to using an incorrect syntax to call to a script includes. Since the inbound action script failed, no incident was created or updated. 

Inside the inbound action code, there is a call to a script includes named 'mylookup' like this, which is not found at execution time:

 var myvalue = mylookup.getValues(email.subject, "incident"); 

The reason why the script includes 'mylookup' is not found, is because the API Namespace is not being used to call it. There are many different application scopes in the instance where this inbound action runs, therefore the script namespace is required to uniquely identify the object being called. In this case, the object was in the global scope and callable from any scope. The solution is to include the API Namespace in the script call, like here:

var myvalue = global.mylookup.getValues(email.subject, "incident"); 


 This change resolved this issue.


Additional Information

The following documentation provide details about ServiceNow API Namespaces:!/document/content/app_store_doc_scoped_script_madrid_c_APINamespaces?v=madrid



Found in London Patch 6, but the same behavior applies to all releases supporting scoped applications.

Article Information

Last Updated:2019-08-02 20:45:46