- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2017 02:26 AM
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2017 03:21 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2017 02:38 AM
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();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2017 02:41 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2017 02:51 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2017 03:06 AM
yeah, that's more or less what I have already, but thought it would be nice if it could fill in group too