- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2024 01:44 PM - edited 11-10-2024 01:47 PM
Hi all,
Just have a question about what process people are doing to update plugins.
Upgrading plugins is easily the worse part of my ServiceNow experience, scheduling the update doesn't work when you have hundreds to deal with.
I've just updated to Xanadu and after making all the initial plugin updates due to the family instance change, I was shocked and frustrated a week later, I had another 250+ updates required (which needs to be completed in 3 separate instances) it's a very time consuming process.
I'm interested in hearing how other people are managing high volume plugin updates, maybe there's a better way that I'm missing.
Ideally, I would like the the ability to opt in to auto update these plugins, overnight between the hours I define and if they don't complete, continue the next night.
Solved! Go to Solution.
- Labels:
-
plugins
- 5,766 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 02:43 AM
Big thanks to @Eric Riemer
/*----------------------------------------------------*/
/* */
/* Have a bunch of apps that need to be updated? */
/* Run this and follow the directions in the output */
/* It will build a payload and use the CI/CD API to */
/* run a batch install of all of the needed updates. */
/* */
/*----------------------------------------------------*/
//Want Demo Data with the app?
var loadDemoData = true;
var prevName;
var appsArray = [];
var grSSA = new GlideRecord('sys_store_app');
grSSA.addEncodedQuery('install_dateISNOTEMPTY^hide_on_ui=false');
grSSA.orderBy('name');
grSSA.orderBy('version');
grSSA.query();
while (grSSA.next()) {
var curName = grSSA.getValue('name');
if (curName == prevName) {
continue;
}
var installedVersion = grSSA.getValue('version');
var latestVersion = grSSA.getValue('latest_version');
if (latestVersion != installedVersion) {
prevName = curName;
var appObject = {
displayName: curName,
id: grSSA.getUniqueValue(),
load_demo_data: loadDemoData,
type: "application",
requested_version: latestVersion
};
appsArray.push(appObject);
}
}
var appsPackages = {};
appsPackages.packages = appsArray;
appsPackages.name = 'Update Apps';
var data = new global.JSON().encode(appsPackages);
var url = 'https://' + gs.getProperty('instance_name') + '.service-now.com/$restapi.do?ns=sn_cicd&service=CICD%20Batch%20Install%20API&version=latest';
gs.info('Open the following URL in a new tab:\n\n' + url + '\n\ncopy/paste the following JSON into the "Raw" Request body\n\n' + data);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
If I ever meet you or Eric in the wild the first beer is on me!! this worked great
