when we select user it showing all users but i want users from one assignment group

Purushotham1992
Tera Contributor

Picture1.png

 

when we select user it showing all users but i want users from one assignment group 

creating variable (reference) in catalog item 

1 ACCEPTED SOLUTION

Hi @Purushotham1992 ,

 

Please try it like this

 

DanishBhairag2_0-1695670290347.png

 

Once u map this n navigate to your form there is good chance u might only see Sys IDs in the search bar of that field. U can just click on the search icon right click on the column - configure layout move sys id towards left & bring users towards right bucket. You should be able to see the Users properly

 

DanishBhairag2_0-1695670950181.png

 

Please mark my answer helpful & accepted if it helps you resolve your query.

 

Thanks,

Danish

 

View solution in original post

5 REPLIES 5

Anand Kumar P
Giga Patron
Giga Patron

Hi @Purushotham1992 ,

  • Write below script in script include

    getUsersByAssignmentGroup: function() {
    var userGr = new GlideRecord('sys_user_grmember');
    userGr.addQuery('group', "sys_id of assignment group");
    userGr.query();

  • var arr=[];
  • while (userGr.next()){
    arr.push(userGr.user);

  • return arr
    }
    };

User variable add below script in reference specification select advanced:

javascript:new scriptinclude name().getscriptincludefunctionname().

Please mark it helpful if it works.

 

Thanks,

Anand