show the groups only where the requested by is a part of

suprajam
Tera Contributor

Hey, i have a reference field which i have to populate with the groups for which the "requested by" is a part of "only". Help please.

12 REPLIES 12

Gunjan Kiratkar
Kilo Patron
Kilo Patron

Hi @suprajam 

Create Script Include as below and use advance reference qualifier to call it.

getGroups :function(){
var groupArr = [];
var uID = gs.getUserID();            
var grmember = new GlideRecord('sys_user_grmember');
      grmember.addQuery('user', uID);
      grmember.addQuery('group.active', true);
      grmember.query();
      while(grmember.next()){
              groupArr.push(grmember.group.toString());
      }
return 'sys_idIN' + ret;
},

Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy

Thank you soo much, hey can i get the reference qualifier script plus i have already two more conditions added to the simple reference qualifier

 

Hi @suprajam ,

Added in reply.

if it resolves your query then mark it as correct and close the thread,


Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy

YEAH SURE THANK YOU ILL TRY AND GET BACK