Hide user records in the Assigned to field.

NARASIMHA REDD5
Tera Contributor

Hi Team,

Based on logged in user I want to hide the user records in Assigned to field.

Example: Which users are in Indian county or Group is -xxx- that user select a --Y-- group in  the assignment group field. we  hide few users in  Assigned to those are in -Y- Group. How can i achieved.

 

 

Thanks

2 ACCEPTED SOLUTIONS

Shivam Techlene
Tera Guru

Hi @NARASIMHA REDD5 ,

 

As per my understanding towards your requirement, you need lookup to only those users in assigned to field who are either member of current assignment group OR whose country is not same as current logged in user. If this is the case, then you can utilize reference qualifier for this. Please use the given code in the reference qualifier of assigned to field.

Steps to Reproduce:

Open dictionary of assigned_to field and under reference specification section, select "Advanced" in "Use reference qualifier" field and write the below code in "Reference qual" field:

 

 

 

javascript:'country' != gs.getUser().country^ORgs.getUser().isMemberOf(current.assignment_group.name);

You can change the conditions as per your exact requirement or let me know if you need any specific modifications.

Please mark my response as helpful and correct if it helps to resolve your requirement.

 

Thanks & Regards,
Shivam Jaiswal

View solution in original post

Hi @NARASIMHA REDD5 there are 2 ways to do this, 1st way Shivam has shared the response , another way you can create a script include to check the users and call the script include in reference qualifier of incident assigned to field by doing dictionary override.

 

Script Include:

checkUser: function(grp) {
        gs.info(grp);
        var arrList = [];
        var gr = new GlideRecord('sys_user_grmember');
        gr.addQuery('group', grp);
      //  gr.addEncodedQuery('user.location!=f69521b437d0200044e0bfc8bcbe5d6e');
        gr.query();
        while (gr.next()) {
            if(gr.user.location !='f69521b437d0200044e0bfc8bcbe5d6e')
            {
            arrList.push(gr.user.sys_id.toString());
            }

        }
        gs.info( arrList.join(','));
        return 'sys_idIN' + arrList.join(',');
    },
HarishKM_0-1707183201957.png

 

 

HarishKM_1-1707183241523.png

call the script include in reference qualifier as below

javascript: new demoUtils().checkUser(current.assignment_group);

HarishKM_2-1707183273768.png

 

Regards
Harish

View solution in original post

7 REPLIES 7

Harish KM
Kilo Patron
Kilo Patron

Hi @NARASIMHA REDD5 I did not get your requirement how ever you would need script include and glide user table or group member table and push the users who need to be visible under assigned to.

can refer below example

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&ved=2ahUKEwiXxNus2IyEAxVgwjgGHdZNCqoQ...

Regards
Harish

@Harish KM : Thank you for you quick response 

 

My question is :

-> If user has Australia country login , in assignment group(particular group) i want to hide particular group members in assign to filed.

 

NARASIMHAREDD5_1-1706931837386.png

 

Hi @NARASIMHA REDD5  are those group members from Australia too? What is the condition to check to remove group members?

Regards
Harish

Hi @Harish KM  thanks for you are replay . yes, those are  users in Australia and Group is -xx-
and the user choose group --Y--  want to hide few users in --y--