Skip to content

Commit f5e449e

Browse files
authored
Create snippet_file.js
1 parent d3cde61 commit f5e449e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
3+
// GlideRecord Example - Query Active Incidents
4+
(function() {
5+
var gr = new GlideRecord('incident');
6+
gr.addQuery('active', true);
7+
gr.orderByDesc('sys_created_on');
8+
gr.setLimit(10);
9+
gr.query();
10+
11+
while (gr.next()) {
12+
gs.info('Number: ' + gr.getValue('number') +
13+
', Short Description: ' + gr.getValue('short_description') +
14+
', Assigned To: ' + gr.getDisplayValue('assigned_to'));
15+
}
16+
})();

0 commit comments

Comments
 (0)