Auto-populate assignment groups in the recent selections of the logged-in user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 06:18 AM
Hi ,
I've logged in to the system and I'm creating an incident record. If I click on the assignment group , I want the assignment groups in which the logged-in user is a member to be listed in the recent selections. I will attach the screenshot here. I want the assignment groups of the logged-in user to be in the recent selections? Is it do-able? Does it require more customizations?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 06:22 AM
Only the change has to be done in the recent selections. Not in the lookup list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 10:25 PM
what do you mean by recent selections?
You can create dictionary override for assignment_group field as it's on task and then show the groups to which logged in user belongs
something like this in dictionary override for incident table
javascript: 'sys_idIN' + new global.ArrayUtil().convertArray(gs.getUser().getMyGroups());
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 06:44 AM
1️⃣ Create a Script Include (Server-side)
•Fetch all assignment groups where the logged-in user is a member.
•Return the list of group sys_ids.
2️⃣ Create an onLoad Client Script (Client-side)
•Call the Script Include to get the list of groups.
•Loop through each group and check if it already exists in Recent Selections.
•If not present, insert it into the sys_ui_recent_selection table.
3️⃣ Expected Outcome:
•When the user clicks on the Assignment Group field, they will see only the groups they are part of in the Recent Selections dropdown.
Let me know if the approach is suitable for your requirement. I can provide the code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 10:01 PM
Can you provide the code