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 Ashby,

I was able to track using Activate/Repair UI Action, which opens up a modal that calls a UI Page. The UI Page name is activate_plugin_confirm. In this UI Page when users hits install, it calls up the onSubmit() in the client script. In this onSubmit(), there is a call to another UI Page simple_progress_viewer_ui16, which contains a parameter to of the AJAX script include GlideMultiPluginManagerWorker. The strange thing about it this UI page is, it cannot be found on the UI page lists.

But still all this make sense as GlideMultiPluginManagerWorker exists in the Script Include list and a sample can be seen there which starts this processing. 

Your solution find is awesome and thanks to ServiceNow community it is still there to help people.

Teena2A1
Tera Contributor

What are the steps to run this script please?

Cem4
Mega Contributor

Thanks Ashby, works fine!

Sundaresan
ServiceNow Employee
ServiceNow Employee

Hi ,

 

Can i use this script and install scoped app or true up plugins ?

or how to install scoped app through back ground scripts?

Joel L
ServiceNow Employee
ServiceNow Employee

Hi there,

I wanted you to be aware that Mark Roethof also has an article that deals with that question. As it is more visible I proposed to him, that he may have a look into the latest outcomes of this thread.

Provision your PDI or company/customer instances quicker, smarter (04): Applying Plugins

It is currently less Sophisicated then Ingimar's script down below.

Kind regards
Joel L.