Use case:We should only see logged in user groups in assigment group Field

shilpapanch
Tera Contributor
 
2 REPLIES 2

Bhavya11
Kilo Patron

Hi @shilpapanch ,

 

can you try something like below

 

 

 

1.. create client callable script include (Client callable )

 

var AssginmentUtils = Class.create();
AssginmentUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
	getloggedinUserGroup:function(){
		var id=[];
		var GroupMember = new GlideRecord("sys_user_grmember");
        GroupMember.addQuery("user", gs.getUserID());
        GroupMember.query();
        while (GroupMember.next()) {
            id.push(GroupMember.getValue('group')) 
        }
        return 'sys_idIN'+id;

	},

    type: 'AssginmentUtils'
});

 

 

2. Go to Dictionary of  assignment group Field, then in Reference specification mention like below

   javascript: new global.AssginmentUtils().getloggedinUserGroup()

Bhavya11_0-1725527590305.png

 

 

then check in field it will only show logged in user group here

 

 

Please mark helpful & correct answer if it's really worthy for you.

 

Thanks,

BK

Mark Manders
Mega Patron

Please explain what it is you are looking for. The 'assignment group' field is a reference to the sys_user_group table, not to users. 

And what do you mean 'should only show logged in users'? Please try to explain what it is you are trying to achieve when asking for help. Not just drop a single line as subject.

 


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark