- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2018 01:56 PM
Ui Action: Assign me
if(gs.getUser().isMemberOf(current.assignment_group));
{
current.assigned_to = gs.getUserID();
}
if he is not a member in that group then popup message
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2018 12:29 AM
Hi,
Try using the below script in UI Action with Client field checked.
Onclick: onClicking()
function onClicking()
{
var gr = new GlideRecord('sys_user_grmember');
gr.addQuery('user',g_user.userID);
gr.addQuery('group',g_form.getValue('assignment_group'));
gr.query();
if(gr.next())
{
g_form.setValue('assigned_to',g_user.userID);
}
else
{
g_form.addInfoMessage('Looged-in user is not a member of the selected Assignment Group');
}
}
Hope this helps.
Thanks,
Archana

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2018 01:59 PM
Where are you running this from? This is server side code, so you wouldn't be able to generate a popup, but you could do gs.addInfoMessage().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2018 02:10 PM
yes..just info meassge...but i am getting error in script
if(gs.getUser().isMemberOf(current.assignment_group));
{
current.assigned_to = gs.getUserID();
}
else
{
gs.addInfoMessage("not mamber");
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2018 02:16 PM
What error are you getting? You might try checking gs.getUser().isMemberOf(current.assignment_group.getDisplayValue())
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2018 02:23 PM