Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Servicenow Script Action not executed

Anubhuti Mittal
Tera Contributor

Hi Team , 

 

I am working in a scoped application . I have to trigger a script that runs in background when a business rule is fired. For this i have created an event and a script action .

The event is fired from a before update business rule.

The event goes into the processed state but the associated script action is never triggered.

 

Business rule code 

gs.eventQueue('sn_vul.<BR NAME>',current, 'XX','YY');
 
 
6 REPLIES 6

Sandeep Rajput
Tera Patron
Tera Patron

@Anubhuti Mittal Did you check if your Script in script action has any syntactical mistakes or the script is crashing. Try to trigger the event via a background script and see if the script triggers if not then try and run the script via a background script and see if it throws any errors.

CharanjeetSingh
Tera Contributor

Hi,
i am also facing the same issue, I have made sure all the above checks. 
My event, BR, Script Action all are in same scope still, event is getting processed but Script action code is not getting executed. 
I am just trying to print log from the script nothing else. 

(function() {
    gs.info("CSSurvey | Survey summary added to incident: ");
})();
tried without function as well
    gs.info("CSSurvey | Survey summary added to incident: ");

Could anyone please guide me what I am missing