Requested Item reference field - Exact filters not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2024 05:01 AM
Hi Team,
I am working on a catalog item, one field is a reference field where users from a specific group should populate.
But I have to use reference table as sys_user table as that tableis accessible to end users.
I have to write a script include and call it over catalog item
below is the script :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2024 05:21 AM
Hi Ballela,
I can suggest a few things:
Best practice is to never embed sys_ids in a script. You are better off looking up the group by name and then getting the sys_id.
Add a statement like this right after grMember.query()
var grMemberCount = grMember.getRowCount();
gs.log("grMemberCount " + grMemberCount);
That will tell you if your filter is working correctly. You can also check the number of entries being returned by adding a log statement to give you the length of userIDs.
I've seen some number of cases where ServiceNow ends up changing javascript: into javascript &colon. That can also be the culprit if the correct number of entries is being returned.
:{)
Helpful and Correct tags are appreciated and help others to find information faster