Assignment group field should show limited groups

Not applicable

Hello everyone!
I was tasked to hide certain groups from the assignment group field. This should be done pretty easily with a dictionary override. But since there are several groups involved I cannot just exclude group type A from the reference qualifier or else the users won't be able to select their groups. Before the ref. qualifier was set up to: Type contains group A OR type contains group B. Now the requirement is to make only Group B available if company is X showing only the results needed for end users working on the incident to select.
How can I achieve this? I have tried a couple script includes but I could not achieve the result intended.

I have attached the scripts for reference.

6 REPLIES 6

Try to give sys_id's instead of group names and see how its working.

Not applicable

It still did not work. But the requirements have changed. 
Thank you for your time anyways. Much appreciated!