Run a script automatically when an update set is committed in an instance

balu3
Kilo Guru

Hi All,

There is a module developed (P) and captured in update set. This module is not standalone. It is an extension of another module (Q) So it can be installed only if other module (Q) is present in the instance.

When this module is installed in any other instance, it needs some configuration to be made. This configuration depends on the target instance module (Q) configuration and some of it's data.

There is a script written to do the configuration. Simply running this script will take care of the above step.

Is there any way to have this script captured in update set (for module P) and run automatically in the target instance when the update set for module (P) is committed.


Thanks
Balu

5 REPLIES 5

Calvaresi E_
Giga Expert

No, because the trigger of the script can't be the commitment of update set in which the script is contained.
You should do it manually (on demand scheduled job? Fix script?) or schedule it in a job (if you know WHEN you are going to promote the US in the target instance.

Let me know if it helps.

asifnoor
Kilo Patron

You can write a BR on sys_udpate_set (after update) and add condition state is committed. 

And under script, you can write your code or can fire a event. And write a script action which can be executed based on the event.

Mark the comment as a correct answer and helpful once worked.

Wow, seriously this is quite unique method.

Like when we install some plugins in ServiceNow, you can sometimes see logs stating executing scripts or so. Like, plugins are more like an application. I was just wondering like, how do they do that.

Has anyone tried these steps? for us the event is not triggering when we mark an update set as complete.