Created
August 18, 2022 20:04
-
-
Save cmcdevitt/32962dc58aa2f41ccf6a62a0858f6490 to your computer and use it in GitHub Desktop.
Discovered Item OS org.mozilla clean up
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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