Created
February 1, 2026 06:45
-
-
Save codaroma/149f0221086351a88ba080abbe314cf0 to your computer and use it in GitHub Desktop.
Manual Clone Cleanup Script Generation
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
| (function () { | |
| var gr = new GlideRecord("clone_cleanup_script"); | |
| gr.orderBy("order"); | |
| gr.orderBy("sys_id"); | |
| gr.addQuery("active", true); | |
| gr.addQuery("name", "NOT IN", [ | |
| "Regenerate all text indexes", | |
| "Exchange Keys for Modules", | |
| ]); | |
| gr.query(); | |
| var s = []; | |
| s.p = s.push; | |
| s.p("(function () {"); | |
| s.p( | |
| " gs" + | |
| '.log("Manual Clone Cleanup: START", "Manual Clone Cleanup");', | |
| ); | |
| s.p(""); | |
| while (gr.next()) { | |
| s.p(" // CLEANUP SCRIPT: " + gr.name); | |
| s.p(" gs" + ".log("); | |
| s.p(' "Manual Clone Cleanup: Executing: ' + gr.name + '",'); | |
| s.p(' "Manual Clone Cleanup",'); | |
| s.p(" );"); | |
| s.p(" try {"); | |
| s.p(" (function () {"); | |
| s.p(" /* "); | |
| s.p("[[[[[[[[[[[[[[[[[[[[ START ]]]]]]]]]]]]]]]]]]]]"); | |
| s.p(" */"); | |
| s.p("" + gr.script); | |
| s.p(" /* "); | |
| s.p("[[[[[[[[[[[[[[[[[[[[ END ]]]]]]]]]]]]]]]]]]]]"); | |
| s.p(" */"); | |
| s.p(" })();"); | |
| s.p(" } catch (e) {"); | |
| s.p(" gs" + ".logError("); | |
| s.p(' "Manual Clone Cleanup: ' + gr.name + '",'); | |
| s.p(' "Manual Clone Cleanup",'); | |
| s.p(" );"); | |
| s.p(" }"); | |
| s.p(""); | |
| } | |
| s.p( | |
| " gs" + '.log("Manual Clone Cleanup: END", "Manual Clone Cleanup");', | |
| ); | |
| s.p("})();"); | |
| s.p(""); | |
| gr = new GlideRecord("sys_script_fix"); | |
| gr.newRecord(); | |
| gr.script = s.join("\n"); | |
| gr.insert(); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment