Activate plugin via script / automatically

Cem4
Mega Contributor

All,

 

is it possible to activate a plugin via script, e.g. set the value of com.glide.service-portal.knowledge-base from false to true. If not, is there another way to activate it automatically, so the activated functionality is a available with the next ServiceNow login?

 

Many thanks

1 ACCEPTED SOLUTION

Ashby
ServiceNow Employee
ServiceNow Employee

You can use the following to automatically activate plugins: 

All you need is the plugin ID..........

//Partial Version
//you can check following URL to see if the work is finished. It is finished when the completion time is set and the percent complete is 100.
//<instance>/sys_execution_tracker_list.do?sysparm_query=name%3DPlugin%20Installer
var plugins = [];
plugins.push('com.snc.pa.change');
plugins.push('com.snc.pa.problem');
plugins.push('com.snc.pa.premium');
plugins.push('com.snc.pa.solution.library');
var main = new GlideMultiPluginManagerWorker();
main.setPluginIds(plugins);
main.setProgressName("Plugin Installer");
main.setBackground(true);
main.start();

View solution in original post

19 REPLIES 19

Hi Ajay,

My use case is to re-install the plugins automatically after a clone.

1) Have a table with the plugin list

2) Launch the script, reading this table and install all plugins

BR

Emmanuel

Ashby
ServiceNow Employee
ServiceNow Employee

You can use the following to automatically activate plugins: 

All you need is the plugin ID..........

//Partial Version
//you can check following URL to see if the work is finished. It is finished when the completion time is set and the percent complete is 100.
//<instance>/sys_execution_tracker_list.do?sysparm_query=name%3DPlugin%20Installer
var plugins = [];
plugins.push('com.snc.pa.change');
plugins.push('com.snc.pa.problem');
plugins.push('com.snc.pa.premium');
plugins.push('com.snc.pa.solution.library');
var main = new GlideMultiPluginManagerWorker();
main.setPluginIds(plugins);
main.setProgressName("Plugin Installer");
main.setBackground(true);
main.start();

Cem4
Mega Contributor

Thanks Ashby, works fine!

This script work well.  Thanks

Can the plugins.push() support loading the demo data?

 

Tx

Andrew

When you created this script and tested successful, where did you create it and did you have to create a scheduled job to run it?