- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
I have 2 users A & B. And B is member of particular group. How to set the assignment group in record producer based on the group membership?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
use this logic in record producer script
I am assuming you want to check logged in user is member of Group A i.e. user who is creating INC
// Replace with actual sys_ids (right-click group header > Copy sys_id)
var groupAId = 'replace_with_group_A_sys_id'; // e.g., 'a1b2c3d4e5f6...'
var groupXId = 'replace_with_group_X_sys_id'; // X assignment group
var groupYId = 'replace_with_group_Y_sys_id'; // Y assignment group
if (gs.getUser().isMemberOf(groupAId)){
current.assignment_group = groupXId;
}
else {
current.assignment_group = groupYId;
}
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @Yakshitha ,
Why set the assignment based on user instead of setting assignment group directly? What is the overall business requirement that you're trying to fulfill?
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday - last edited yesterday
If the group A member submit the request it should be assigned to X assignment group and users other than A group member submit request it should be assigned to Y assignment group. This is the requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
use this logic in record producer script
I am assuming you want to check logged in user is member of Group A i.e. user who is creating INC
// Replace with actual sys_ids (right-click group header > Copy sys_id)
var groupAId = 'replace_with_group_A_sys_id'; // e.g., 'a1b2c3d4e5f6...'
var groupXId = 'replace_with_group_X_sys_id'; // X assignment group
var groupYId = 'replace_with_group_Y_sys_id'; // Y assignment group
if (gs.getUser().isMemberOf(groupAId)){
current.assignment_group = groupXId;
}
else {
current.assignment_group = groupYId;
}
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
