Ankur Bawiskar
Tera Patron

@anushadande1793 

you should be using advanced ref qualifier on the list collector variable

Script Include:

var UserUtils = Class.create();
UserUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
	
	getMembers: function(groupId){
		var id = [];
		var gr = new GlideRecord('sys_user_grmember');
		gr.addQuery("group", groupId);
		gr.query();
		while(gr.next()){
			id.push(gr.getValue("user"));
		}
		return "sys_idIN"+id.join();
	},

    type: 'UserUtils'
});

Also use this in the variable attributes for that list collector; without this it won't work in list collector variable

ref_qual_elements=groupVariableName

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader