how to get the group names which are having group type as SME

sajampan
Mega Contributor
 
10 REPLIES 10

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @sajampan 

Where exactly do you want to show it — in the Assignment Group field?
If so, add this condition in the Dictionary.

 

DrAtulGLNG_0-1755615306675.png

 

*************************************************************************************************************
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]

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

GlideFather
Tera Patron

Hi @sajampan,

 

go to Groups [sys_user_group] and set the conditions accordingly:

GlideFather_0-1755615291267.png

 

My instance doesn't have the SME group type so I used itil for demo purposes...

 

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


@sajampan eventually a script:

 

var grSUG = new GlideRecord('sys_user_group');
grSUG.addEncodedQuery("typeLIKE1cb8ab9bff500200158bffffffffff62"); //update the group type sys ID
grSUG.orderBy('name');
grSUG.setLimit(100);
grSUG.query();
while (grSUG.next()) {
    gs.info('name: ' + grSUG.getValue('name'));
    gs.info('description: ' + grSUG.getValue('description'));
    gs.info('active: ' + grSUG.getValue('active'));
    gs.info('manager: ' + grSUG.getValue('manager'));
    gs.info('parent: ' + grSUG.getValue('parent'));
    gs.info('sys_updated_on: ' + grSUG.getValue('sys_updated_on'));
}
———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Rafael Batistot
Tera Sage

Hi @sajampan 

 

May you try in background script 

 

var gr = new GlideRecord('sys_user_group');
gr.addQuery('type.name', 'SME'); // 'type' references sys_user_group_type
gr.query();
while (gr.next()) {
gs.print(gr.name);
}