how to Check user is belong to this group or not
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2017 11:19 PM
When i click on "Assign to me" UI ACTION -button user name is filled in "Assign to" , but user is not belongs to "project Mgnt" group then display message- ''user not in this group''.
var aa=g_user.getUserID();
g_form.setValue('u_assign_to_me',aa);
now i want , 1. if user belong to that group display username in "Assign To" filed
2. if user is not belongs to that assignment group should display message, and assignment group should become blank but display username in "Assign To" filed and based on username ''Assignment Group'' display user related groups in ''Assignment Group'' field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2017 12:08 AM
HI Kishore you gave me this requirement --- "WHAT I AM expecting is when i click on " UI Action " BUTTON user name should display in Assign to field if he belong to that Assignment Group OTHER wise name should display in assign to field but Assignment Group should become blank."
Please explain me the requirement properly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2017 12:32 AM
i will explain you clearly..
when i click on " UI Action " BUTTON user name should display in ''Assign To'' field if he belong to that ''Assignment Group'
if user name not belong to that ''Assignment Group'' user name should display in ''assign to field'' and related his member ship Groups should populate in Assignment Group field .

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2017 12:35 AM
I would invite you to please go through already shared code and wiki links
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2017 02:52 PM
when i click on " UI Action " BUTTON user name should display in ''Assign To'' field if he belong to that ''Assignment Group'
if user name not belong to that ''Assignment Group'' user name should display in ''assign to field'' and related his member ship Groups should populate in Assignment Group field .
can we display group name at least based on group type............

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2017 11:29 PM
Hello Kishore,
Uncheck the client checkbox on UI action and the script will be
current.u_assign_to_me = gs.getUserID();
if(gs.getUser(). isMemberOf( 'current.assignment_group'))
{
//do nothing
}
else
{
current.assignment_group = '';
var gr = new GlideRecord('sys_user_grmember');
gr.addQuery('user', gs.getUserID());
gr.query();
if(gr.next())
{
current.assignment_group = gr.group; //One of the random group will be set here. I'm not clear with your req if this is expected?
}