March 2017
Beginner
358 pages
9h 51m
English
Let's look at an example where you want to have a script pull up to 10 incidents from the database in order to assign them to a particular user, whose sys_id is already stored in the assignee variable. But you don't just want to assign 10 random incidents from the queue; you would probably want to make sure that you got the highest priority ones first:
var gr = new GlideRecord('incident'); gr.addQuery('assignment_group', assignmentGroup); gr.orderBy('priority'); gr.setLimit(10); gr.query(); gr.setValue('assigned_to', assignee); gr.updateMultiple();
Read now
Unlock full access