Make Assign to me button fill in assignment group field

maymunTesm
Kilo Expert

Hi all,

I wanted to make the UI action 'Assign to me' button fill in the assignment group of the clicker, but i'm pretty new to coding. Could you please suggest some code that would help?

1 ACCEPTED SOLUTION

basically, one user can be part of multiple assignment group so assign to me should ideally set only assigned to. if you are sure that users will be allocated to one group only then set assignment group.


View solution in original post

10 REPLIES 10

It can fill the group, if the user is part of one group only.



var gr = new GlideRecord('sys_user_grmember');


gr.addQuery('user',gs.getUserID());


gr.query();


if(gr.next())


{


current.assigned_group = gr.group;


}


current.update();



thanks,


Souren


** current.assignment_group = gr.group;


Mihir Mohanta
Kilo Sage

Create an UI action like below image.(Change the table name and field names if required)



find_real_file.png


yeah, that's more or less what I have already, but thought it would be nice if it could fill in group too


basically, one user can be part of multiple assignment group so assign to me should ideally set only assigned to. if you are sure that users will be allocated to one group only then set assignment group.