Ability to specify which group we DO NOT want to appear on the “assignment group” field

sagar0711
Tera Contributor

I have created a one-check box with the label "not visible in assignment group"  in the group table form when that checkbox is selected we want to make sure the group is not visible in any Assignment groups How can we do this using script

1 ACCEPTED SOLUTION

You can create a before query business rule in groups table which should trigger only for sys_ref_list

view.

refer below script

 

if(gs.action.getGlideURI().getMap().get('sysparm_view')=='sys_ref_list'){

current.addQuery('checkboxfieldname',false); // will show only groups with that checkbox is false
}

 

View solution in original post

8 REPLIES 8

Thanks a lot. it's working.

Aachal_13
Tera Contributor

Hello @sagar0711  you can use a Business Rule to run server-side scripting when the checkbox is selected  Here's an example script

 

(function executeRule(current, previous /*, gs */ ) {
// Check if the "Not Visible in Assignment Group" checkbox is selected
if (current.getValue('not_visible_in_assignment_group')) {
// Set the 'active' field to false to make the group not visible in assignment groups
current.setValue('active', false); // Optionally, you might want to clear any assignment group references current.setValue('assignment_group', ''); // Add any additional logic or actions based on your requirements }
})(current, previous); 

This script should be in Business rule 'When condition set to 'before' and 'insert/update'. It checks if the "not visible in assignment group" is selected. If true, It sets the 'active' field to false and clears any assignment group references.

Hope this helps...

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @sagar0711 

 

I think It is OOtb, means on group table there is field Calle Type, and you can create own types in that.

 

If field is not on form, you can bring via Form Layout.

 

Now you can go to assignments group dictionary entry and I reference qualifier you can mention which type of groups should a user see or available for selection.

 

Give a try and share feedback. 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************