find_real_file.png



find_real_file.png




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............


Pradeep Sharma
ServiceNow Employee

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?


}



Hi Prasdeep ,




Thanks for your fast replay ,



here code is not working , it is submitting form and not taking any user name into Assign To field .



could you plse ...


Can you please share screenshot of UI action here.


find_real_file.png




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, based on Assign To user name Groups should populate in Assignment Group,   in which groups he is being as a member