We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

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

sajampan
Tera Contributor
 
10 REPLIES 10

Dr Atul G- LNG
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

 

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

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

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...

 


✂-----Cutting-out-the---✦AI-noise✦---All-replies-written-and-vouched-for-by-GlideFather---

@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'));
}

✂-----Cutting-out-the---✦AI-noise✦---All-replies-written-and-vouched-for-by-GlideFather---

Rafael Batistot
Kilo Patron

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);
}

If this response was helpful, please mark it as Helpful and, if applicable, as Correct.
This helps other users find accurate and useful information more easily