I want to remove the the user from assigned to field but the user must present in the group??

gokulraj
Giga Expert

My requirement is to hide the user1 from assigned to when selecting the assignment group while creating an incident ,but the user must be a member in   the group.

1 ACCEPTED SOLUTION

This needs to be added as an advnaced reference qualifier to the assigned_to field, not assignment_group.


View solution in original post

26 REPLIES 26

The script include i sent is building a list of the sys_id's of users you want to be available in the reference field. The argument you're returning is:



'sys_id=1234^ORsys_id=sys id of user 1^ORsys_id= sys id of user 2' etc etc



It won't match anything to the 1234, that's just a dummy number to get the syntax in place. Once sys_id=1234 is in place you can repetitively add ^ORsys_id=sys id of user as many times as there are users in the while loop.


Hi David Dubuis



gr.addEncodedQuery('group=' + current.assignment_group + '^user!=9ee1b13dc6112271007f9d0efdb69cd0');  



is the above code used to exclude the user from that group?


yeah, the glide record is going into the sys_user_grmember table where all the group membership records are stored. Then the encoded query is returning all the records in that table where the group is the same as the current assignment group and the user is not the user you want to exclude.



Have a read through the below link, it's a good guide on how to write glide records.



How To Write GlideRecord Queries Like A Pro


Hello David Dubuis



How to re-assign an incident to other group if the user is a member of that group only?



I have a requirement like all software assignment group incidents have to assign to network group only by the network group members.How to achieve this?




Regards,


Gokulraj S


Hi Gokulraj,



Start a new thread for that, this one is closed.