Reference Qualifiers - Adding Multiple Conditions

andrewdunn
Giga Expert

Hi - looking for some assistance.

I believe this is an easy issue which I just cannot get my text correct

I have my assignment group Reference Specification as:

  • Use reference qualifier: Advanced
  • Reference qual: javascript:new BackfillAssignmentGroup().BackfillAssignmentGroup()

The above means that if an "Assigned To:" person is entered and the ITIL user wants to see what Assignment groups they are a member of they get the correct list.

What I want to do is also have the Assignment Group limited to just those groups that start with "IT"

If I do a simple qualifier I get the code "nameSTARTSWITHIT^EQ"

However I cannot combine them into one string to both work


What I have tried (amongst other options):  

  • javascript:'new BackfillAssignmentGroup().BackfillAssignmentGroup()^'+nameSTARTSWITHIT^EQ()
  • javascript:'new BackfillAssignmentGroup().BackfillAssignmentGroup()^'^nameSTARTSWITHIT^EQ()

Any ideas would be appreciated

cheers

1 ACCEPTED SOLUTION

Sure. Try this:



javascript: var refQual = ''; if (current.assigned_to != '') {var usr = gs.getUser(); usr = usr.getUserByID(current.assigned_to); var grp = usr.getMyGroups().toArray(); refQual = 'sys_idIN' + grp.join()} refQual += '^nameSTARTSWITHit'; refQual;


View solution in original post

20 REPLIES 20

andrewdunn
Giga Expert

Thanks Slava - brilliant - exactly what I was looking for.


We deployed servicenow about 4 months ago and I have been developing for 4.5 months. I am a backup to the backup and project resource.


Much appreciated


cheers


Great! I am happy I could actually help you out.


This is (almost!) exactly what I've been looking for!



- If I wanted to filter by groups of type 'Support' rather than groups starting with 'IT' how would I achieve this?



Any assistance appreciated!


Replace nameSTARTSWITHit with typeLIKEid where id is the sys_id of Support group type record in sys_user_group_type table.


Works perfectly, thank you very much.