In the assigned to i want to see particular group members name

pavithraptr
Tera Contributor

In the assigned to i want to see particular group members name without applying anything on assignment group. which query i need to use in reference qualifier 

5 REPLIES 5

GlideFather
Tera Patron

Hi @pavithraptr,

 

can you please give any example? I'm not sure I understand your requirement..

 

On default, Assigned to can be only selected from group that is selected in Assignment group. This is the best practice because one user can be a member of more groups, so if you assign the Assignee first and then group it will might bring some incorrect assignments...

 

There is something called Reference qualifier, which defines record that are qualified (selectable) for the reference... it can be as per category, or anything else. 

 

"i want to see particular group members name without applying anything on assignment group" <<< this isn't consider good practice, do you have any specific reason for that?

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


I have a group called leads. In the form i have a assessment leads field.When i try to select assessment leads it should only show members who are members of leads group

Hi @pavithraptr,

 

on the variable where you want to select the group members you need to call script include that will return the group members.

 

Something like this:

GlideFather_0-1757532238273.png

variable's ref qualifier on sys_suer table:

javascript&colon; 'sys_idIN' + new groupUtils().getSandstormMembers();

 

calling script include called groupUtils and function getSandstormMembers()

 

And the script include:

GlideFather_1-1757532343078.png

 

 

var groupUtils = Class.create();
groupUtils.prototype = {
    initialize: function() {},

    getSandstormMembers: function() {
        var userIDs = [];
        var gr = new GlideRecord('sys_user_grmember');
        gr.addEncodedQuery('group=YOUR_GROUP_SYS_ID^user.active=true');
        gr.query();
        while (gr.next()) {
            userIDs.push(gr.user.toString());
        }
        return userIDs.join(',');
    },

    type: 'groupUtils'
};

 

This will return just the active members, so even a group member of that group who is inactive won't be selectable. If you want to allow inactive suers as well, remove the "^user.active=true" part from the encoded query.

 

Let me know if this helped, works fine for me

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Nikhil Bajaj9
Tera Sage

Hi @pavithraptr ,

 

You need to go for the query which will bring that particular group member name 🙂 .  Since your question is incomplete so answer is accordingly. 

 

 

Please appreciate my efforts, help and support extended to you by clicking on – “Accept as Solution”; button under my answer. It will motivate me to help others as well.
Regards,
Nikhil Bajaj