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

sunilsafare
Mega Guru

Hi Maymun,



One user might be part of multiple groups, so how you are deciding that which group who want to bring for the logged in user. For coding part you can put the below code in the ui action




current.assignment_group = '<ref_id>';


current.update();


Thanks Sunil,



Yeah that's what I was wondering actually, which group will be used... Maybe we will need to make the 'assignment group' a field on the user record


Is this a business requirement or you are practicing? I don't think it's a valid requirement. If your assigned group is filled, you can create an UI action to assign it to yourself in assigned to field.



Please create an ui action with preferred table:



script:



if(gs.getUser().isMemberOf(current.assignment_group))


{


current.assigned_to = gs.getUser();


current.update();


}



Regards,


Souren



hit like/helpful/correct based on impact


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