Plugins update with Script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2023 11:34 PM
Is there any way the plugins can be updated using background scripts, other than directly updating from UI or downloading it from store?
10 REPLIES 10
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
(function() {
var grSSA = new GlideRecord('sys_store_app');
grSSA.addActiveQuery();
grSSA.addQuery('update_available', true);
grSSA.setLimit(10);
grSSA.query();
if (grSSA.next()) {
var storeVersion = grSSA.getValue('latest_version');
var appSysId = grSSA.getUniqueValue();
try {
var worker = new sn_appclient.AppUpgrader();
worker.upgrade(appSysId, storeVersion, false);
gs.print("SUCCESS: Remote handshake completed! Upgrade task handed over to background node.");
gs.print("Check 'sys_upgrade_history.list' to monitor progress.");
} catch (ex) {
gs.print("ERROR during upgrade processing: " + ex);
}
} else {
gs.print("ERROR: Could not find any app record matching ID: " + targetAppId);
}
})();
Try this