- 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:10 PM
Hi @Servicenow de11 ,
Check the before or after insert business rules on incident table they are setting the default group to Default Fulfiller if no members in existing group.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 11:12 PM
when are you planning to set the group?during insert or at some other point of time?
you can use before insert/update BR for this
what script did you start with?
you can query sys_user_grmember to check if any members are present or not and then set the value
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 11:18 PM
Hello Ankur,
Did not start any script. How to write script for that logic.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 11:24 PM
I am planning to set the default group during insert. how to query if any members are present or not?