Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Assign incident ticket based upon shift timings to respective user

awakevima19
Kilo Contributor

Requirement

 

Need to assign the priority tickets to respective groups based on their shift roster available users . How we can achieve this test case please suggest ?

2 REPLIES 2

SumanthDosapati
Mega Sage

@awakevima19 

This link might help you.

 

Regards,
Sumanth

yashkamde
Mega Sage

Use BR for that,

if (current.priority <= 2) {

var grp = new GlideRecord('sys_user_group');
grp.addQuery('u_supports_priority', true); // custom flag
grp.query();

while (grp.next()) {

var usr = new GlideRecord('sys_user');
usr.addQuery('active', true);
usr.addQuery('sys_user_grmember.group', grp.sys_id);
usr.addQuery('sys_user_schedule.schedule.is_active', true);
usr.query();

if (usr.hasNext()) {
current.assignment_group = grp.sys_id;
break;
}
}

// fallback
if (!current.assignment_group)
current.assignment_group = 'BACKUP_GROUP_SYS_ID';
}

You you want screenshot I can share though..
If you find this helpful mark as helpful and accept solution..