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

Ankur Bawiskar
Tera Patron
Tera Patron

@DIVI1 

where are you writing this script?

Can you explain complete business requirement?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur
That's the point, cause I'm not sure right now what should it be client script or BR, That part of the script I just prepared in Business Rule.

 

Business expect, the possibility to change assignment group to another should be avalaible only for users which are a part of group 'Problem Coordinators', If user is not a part of this group the only group which he can choose is 'Problem Coordinators' 

Hello @DIVI1 ,

You can try this with Dynamic Reference Qualifier for the Assignment Group field, You can write a script include, and call it from Dynamic Filter.

 

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

Ok, I'm not sure how the Script part should look like.