var gr = new GlideRecord('incident'); // use the incident table
gr.query(); // fetch data from the database
while (gr.next()) { // advance
gs.info(gr.short_description);
}
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 getCatalog = new GlideRecord("sc_cat_item"); | |
| getCatalog.addEncodedQuery("active=true^hide_sp=false^sys_class_name=sc_cat_item"); //Update this | |
| getCatalog.query(); | |
| while (getCatalog.next()) { | |
| var addVariableSet = new GlideRecord("io_set_item"); | |
| addVariableSet.initialize(); | |
| addVariableSet.sc_cat_item = getCatalog.getValue("sys_id"); | |
| addVariableSet.variable_set = "86f3c8b51b0d9c508ed631d7dc4bcbcd"; //variable set sys_id |