Skip to content

Instantly share code, notes, and snippets.

@cmcdevitt
Created August 18, 2022 20:04
Show Gist options
  • Select an option

  • Save cmcdevitt/32962dc58aa2f41ccf6a62a0858f6490 to your computer and use it in GitHub Desktop.

Select an option

Save cmcdevitt/32962dc58aa2f41ccf6a62a0858f6490 to your computer and use it in GitHub Desktop.
Discovered Item OS org.mozilla clean up
var gr = new GlideRecord("sn_sec_cmn_src_ci");
gr.addEncodedQuery("osSTARTSWITHorg.mozilla.javascript.NativeArray");
//gr.setLimit(100);
gr.query();
while (gr.next()) {
var sourceData = JSON.parse(gr.getValue("source_data"));
var os = sourceData["operating_system"];
if (os) {
//"operating_system" object found in Source Data
gr.setValue("os", os.toString());
} else {
//No "operating_system" object in Source Data
gr.setValue('os', '');
}
gr.setWorkflow(false);
//Uncomment the line below only after you are sure....
//gr.update();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment