Automatic Plugin Validation In Service Now

rajan_singh
Tera Contributor

Hi All,

I want to find a table in service now where all the plugins that have installed are stored as records. I want to write a script that automatically verifies the plugins installed but I couldn't find any table where all the plugins that I installed are present. I referred to sys_upgrade_history,v_plugin,sys_plugins but in these only few plugins installed were there not all. Attaching the sample code below.

(function() {
    // Array of plugin IDs and their names
    var plugins = [
        {id: 'sn_fin', name: 'Finance Common Architecture'}
    ];
 
    // Initialize the output string with headers
    var output = 'Plugin ID\tPlugin Name\tStatus\n';
 
    // Iterate over each plugin and check its status
    plugins.forEach(function(plugin) {
        var gr = new GlideRecord('sys_upgrade_history');
gr.addQuery('to_version', plugin.id);
        gr.query();
       
        if (gr.next()) {
output += plugin.id + '\t' + plugin.name + '\tInstalled\n';
        } else {
output += plugin.id + '\t' + plugin.name + '\tNot Installed\n';
        }
    });
 
    // Print the output
gs.info(output);
})();
1 ACCEPTED SOLUTION
1 REPLY 1