How Could I autocomplete assignment group IF

DIVI1
Tera Expert

I Have to prepare something like this:

If User is not member of 'group' - then he can Choose only 1 group, of course if he decide about to change assignment group. I'm working on Problem Table.

Here is example what is not working right now 😕 

    if (!gs.getUser().isMemberOf('6ae3f5b21b479850bf327bb5464bcb45') && gs.getSession().isInteractive()) {
     current.addQuery('assignment_group', '6ae3f5b21b479850bf327bb5464bcb45');

I thought that 'isInteractive()' will help but I was wrong.. 

1 ACCEPTED SOLUTION

Hello @DIVI1 ,

Please find the below code, Goto Dictionary entry of Assignment group in problem form, and enter below code in Dictionary override -> Override Reference qualifier (check box)

 

 

javascript: if(!gs.getUser().isMemberOf('0c4e7b573b331300ad3cc9bb34efc461')) { "name=Problem Analyzers^EQ" } else { "name!=Problem Analyzers^EQ" }     // Here I used Problem Analyzer Group for my convenient, you can replace your Problem Coordinator sys_id and name at respected places.

 

 

Please mark my answer correct & helpful, if it helps you

Thank you

 

 

 

Please mark my answer helpful  & correct if it helps you
Thank you

G Ramana Murthy
ServiceNow Developer

View solution in original post

8 REPLIES 8

Hello @DIVI1 ,

Please find the below code, Goto Dictionary entry of Assignment group in problem form, and enter below code in Dictionary override -> Override Reference qualifier (check box)

 

 

javascript: if(!gs.getUser().isMemberOf('0c4e7b573b331300ad3cc9bb34efc461')) { "name=Problem Analyzers^EQ" } else { "name!=Problem Analyzers^EQ" }     // Here I used Problem Analyzer Group for my convenient, you can replace your Problem Coordinator sys_id and name at respected places.

 

 

Please mark my answer correct & helpful, if it helps you

Thank you

 

 

 

Please mark my answer helpful  & correct if it helps you
Thank you

G Ramana Murthy
ServiceNow Developer

Unfortunately do not work, I can see All of the groups

can you share screenshots of your work... then It will be easy to answer

Please mark my answer helpful  & correct if it helps you
Thank you

G Ramana Murthy
ServiceNow Developer

Now it's working! 
I used:

 

javascript: if(!gs.getUser().isMemberOf('6ae3f5b21b479850bf327bb5464bcb45')) { "name=Problem Coordinators^EQ" } else { "name!=Problem Coordinators^EQ" }

 

 

in Dictionary override -> Override Reference qualifier

 

Do you know why javascript: didn't work ?