- 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 03:16 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2017 03:17 AM
** current.assignment_group = gr.group;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2017 03:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2017 03:16 AM
yeah, that's more or less what I have already, but thought it would be nice if it could fill in group too
- 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.