Run a script automatically when an update set is committed in an instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2019 12:05 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2019 03:54 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2019 04:05 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2019 01:04 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2020 10:39 PM
Has anyone tried these steps? for us the event is not triggering when we mark an update set as complete.