- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 03:51 PM - edited 09-20-2023 03:52 PM
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())
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 04:03 PM - edited 09-20-2023 04:07 PM
Hi @Bcrant ,
Try the following Reference Qualifier.
javascript:'typeLIKE1cb8ab9bff500200158bffffffffff62^sys_idIN' + new global.ArrayUtil().convertArray(gs.getUser().getUserByID(current.assigned_to.toString()).getMyGroups())
In the above statement replace : next to javascript with :
Please mark my answer helpful and accept as solution if it helped you 👍✅
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 04:03 PM - edited 09-20-2023 04:07 PM
Hi @Bcrant ,
Try the following Reference Qualifier.
javascript:'typeLIKE1cb8ab9bff500200158bffffffffff62^sys_idIN' + new global.ArrayUtil().convertArray(gs.getUser().getUserByID(current.assigned_to.toString()).getMyGroups())
In the above statement replace : next to javascript with :
Please mark my answer helpful and accept as solution if it helped you 👍✅
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2023 08:04 AM
Not sure why it copied that way but ":" is present. Thanks for reply ✌️
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2023 12:55 PM
@Bcrant it is because ServiceNow escapes them to prevent that script being executed.
Any way did it helped you to fix the issue? If it is please accept my answer as solution
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 04:11 PM
Hey @Bcrant
I would not recommend your code because for example if you are part of a child group and if the child group has a parent group then it will also return the parent groups even if you are not a member of the parent groups. So, apply your logic if you don't want to return the parent groups.
Let me know if any confusion.
Happy to help:)
Murthy
Murthy