Script Action Not Working

steph3
Tera Contributor

Hello,

I have set-up a record producer to collect some information and from the record producer I am calling a script include which then calls an event to trigger a script action. My event is firing and everything looks good   from there but for some reason I cannot get the script action to fire. I have it marked as active and purely for testing purposes I just have a "gs.info('this is working');" message. But I cannot get it to output. Any ideas?

Thanks for your time!

1 ACCEPTED SOLUTION

Deepak Ingale1
Mega Sage

Please check the domain of script action if you are working in domain separated instance.


Script Action must be in a global domain in order to run.


View solution in original post

5 REPLIES 5

Josh101
Giga Contributor

I'm having a similar issue. 
Before Business rule triggers on Delete of CI on cmdb_rel_ci table. And successful creates an Event,I have confirmed by checking the Events table.

(function executeRule(current, previous /*null when async*/ ) {
	gs.info('Event Created');
	gs.eventQueue(name='x_lomo_lmcmdbint.Custom-Applications-App',current, 'This is Param Onezzzzz', 'This is Param Twozzzzz');
})(current, previous);

I have a Action Script Set to trigger (in Global Scope) that runs the code below when this type of event is triggered.

try {
    var eventParam1 = event.parm1;
    var eventParam2 = event.parm2;

    gs.error('Script Action Triggered');
    gs.info(eventParam1);
    gs.info(eventParam2);

    gs.info('Script Action Ended');
} catch (error){
	gs.error('Script action failed');
	gs.error(error);
}

 

This does not get logged anywhere, which indicates to me that it is failing to rigger.

Both the Business Rules and Action Script are in the same Scoped Appliction context.
The generated Events, Business Rule, and Action Script are all created and run by the same user, me.

Why am I missing here? Any help would be much appriciated.