Assignment group for logged in user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2023 12:55 PM
Hi,
I want to display only those groups in the 'Assignment group' field where the logged-in user is a member. I tried using the following script in the HR Template on HR Service, but it didn't work.
javascript:'sys_idIN' + new global.ArrayUtil().convertArray(gs.getUser().getMyGroups());
Does anyone have suggestions on how to display groups specific to the logged-in user in the 'Case Creation' section?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2023 02:34 PM - edited 08-28-2023 02:37 PM
Yes 'javascript:' is an outstanding syntax issue with the community forums, when you add code.
Edited as plain text is also converted incorrectly.
Your entry should be 'javascript' and a colon with no spaces , followed by you refqual condition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2023 02:40 PM - edited 08-28-2023 02:42 PM
that's what I did, I used javascript and colon symbol
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2023 02:48 PM
also when I checked this in background script I got array with comma separated sysids
gs.info(gs.getUser().getMyGroups().toString());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2023 02:55 PM
even if I used
new global.ArrayUtil().convertArray(gs.getUser().getMyGroups())
instead of
gs.getUser().getMyGroups().toString()
it still doesn't work with syntax javascript:
in background when printing gs.info(new global.ArrayUtil().convertArray(gs.getUser().getMyGroups()));
I got sysids comma separated but without array
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2023 02:49 PM
Sorry, small error on my part, 'sys_id' needs to be 'assignment_group' as it's the sys_id of the assigment group we are filtering for.