Filter assignment group to specific groups that current assigned_to user is a member of

Bcrant
Tera Contributor

Hello, all.

 

I recently setup an advanced reference qualifier on our assignment_group field to return groups that the assigned_to user is a member of. I'd like to further filter that query to show only a specific group type of "itil" and hoping one of you cold assist. Below is the script we're using...

 

javascript: 'sys_idIN' + new global.ArrayUtil().convertArray(gs.getUser().getUserByID(current.assigned_to.toString()).getMyGroups())

1 ACCEPTED SOLUTION

Aylee Andersen
Kilo Sage

Hello @Bcrant,

 

You should be able to add "^type=1cb8ab9bff500200158bffffffffff62" to the end of your query string to only show groups of type "itil". That would give you the following reference qualifier:

 

javascript: 'sys_idIN' + new global.ArrayUtil().convertArray(gs.getUser().getUserByID(current.assigned_to.toString()).getMyGroups()) + '^type=1cb8ab9bff500200158bffffffffff62';

 

Note that hardcoding the sys_id is frowned upon, but you could throw a basic query in there to dynamically grab the sys_id of the itil group type if you wanted. But this should at least point you in the right direction.

 

Hope that helps!

View solution in original post

2 REPLIES 2

Aylee Andersen
Kilo Sage

Hello @Bcrant,

 

You should be able to add "^type=1cb8ab9bff500200158bffffffffff62" to the end of your query string to only show groups of type "itil". That would give you the following reference qualifier:

 

javascript: 'sys_idIN' + new global.ArrayUtil().convertArray(gs.getUser().getUserByID(current.assigned_to.toString()).getMyGroups()) + '^type=1cb8ab9bff500200158bffffffffff62';

 

Note that hardcoding the sys_id is frowned upon, but you could throw a basic query in there to dynamically grab the sys_id of the itil group type if you wanted. But this should at least point you in the right direction.

 

Hope that helps!

Bcrant
Tera Contributor

Thank you for your feedback, @Aylee Andersen. Much appreciated.