Reference field referring to user table

Not applicable

Hi,

 

I have a reference field named "TRO" on the incident which refers to the user table & we have to show users who are part of the "ABC" group. Can someone please help me out on this?

 

Regards,

Chirag Jain

2 REPLIES 2

Ankur Bawiskar
Tera Patron

@Community Alums 

2 ways

1) have role assigned to that group and then assign advanced ref qualifier with roles=roleABC

OR

2) have advanced ref qualifier and call script include and get group members of that group

what did you start with and where are you stuck? this is an easy task

Mark Manders
Tera Patron

Create a script include:

var ABCGroupUsers = Class.create();
ABCGroupUsers.prototype = {
    initialize: function() {
    },
    
    getABCGroupUsers: function() {
        var users = [];
        var grMember = new GlideRecord('sys_user_grmember');
        grMember.addQuery('group.name', 'ABC');
        grMember.query();
        while (grMember.next()) {
            users.push(grMember.user.sys_id.toString());
        }
        return users.join(',');
    },

    type: 'ABCGroupUsers'
};

 

And set the reference qualifier on the field to this: 

 

javascript: 'new ABCGroupUsers().getABCGroupUsers()'