- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 10:47 PM
Hello,
I have a requirement that is in the incident table the assignment group has no group members automactically it will changes to 'Default Fullfiller' assignment group. Can anyone help me the script to achieve this requirement.
Thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 11:41 PM
Hi @Servicenow de11 ,
Create before insert business rule on incident table
(function executeRule(current, previous /*null when async*/ ) {
var getassignmentgroup = current.assignment_group;
var groupMember = new GlideRecord('sys_user_grmember');
groupMember.addQuery('group', getassignmentgroup);
groupMember.addQuery('user.active', true);
groupMember.query();
if (!groupMember.next()) {
current.assignment_group = '';
current.assignment_group = '3cc3c7680b982300cac6c08393673a03';//craete system propoerty to replace sysid
current.setWorkflow('false');
current.update();
}
})(current, previous);
Please mark it as helpful and solution proposed if its serves your purpose.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 11:41 PM
Hi @Servicenow de11 ,
Create before insert business rule on incident table
(function executeRule(current, previous /*null when async*/ ) {
var getassignmentgroup = current.assignment_group;
var groupMember = new GlideRecord('sys_user_grmember');
groupMember.addQuery('group', getassignmentgroup);
groupMember.addQuery('user.active', true);
groupMember.query();
if (!groupMember.next()) {
current.assignment_group = '';
current.assignment_group = '3cc3c7680b982300cac6c08393673a03';//craete system propoerty to replace sysid
current.setWorkflow('false');
current.update();
}
})(current, previous);
Please mark it as helpful and solution proposed if its serves your purpose.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 11:54 PM
Hello Anand Kumar,
Thanks for the script. Its working