diff --git a/Core ServiceNow APIs/GlideRecord/Query Active Incidents/snippet_file.js b/Core ServiceNow APIs/GlideRecord/Query Active Incidents/snippet_file.js new file mode 100644 index 0000000000..b66779ed61 --- /dev/null +++ b/Core ServiceNow APIs/GlideRecord/Query Active Incidents/snippet_file.js @@ -0,0 +1,16 @@ + + +// GlideRecord Example - Query Active Incidents +(function() { + var gr = new GlideRecord('incident'); + gr.addQuery('active', true); + gr.orderByDesc('sys_created_on'); + gr.setLimit(10); + gr.query(); + + while (gr.next()) { + gs.info('Number: ' + gr.getValue('number') + + ', Short Description: ' + gr.getValue('short_description') + + ', Assigned To: ' + gr.getDisplayValue('assigned_to')); + } +})();