- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2025 05:50 AM - edited 01-31-2025 05:55 AM
Looking for a little advice. I have a business rule that is supposed to be updating a list field on one table to the list field on another table. Both fields setup exactly the same, list types with a reference to the sys_user_group_type table in order to select multiple types.
The business rule looks like it's working according to the logs I have added, the log is showing multiple sysids after the business rule runs. However, on the target table, after the business rule has run, the field only shows the first result in the list (it only ever has one entry in it, even though the log is showing all sysids are being passed). I'm stuck trying to figure out what is going on at this point.
It is a before insert/update business rule set to run when the assignment group changes:
(function executeRule(current, previous /*null when async*/) {
var groupSysId = current.assignment_group;
var groupRecord = new GlideRecord('sys_user_group');
if (groupRecord.get(groupSysId)) {
var groupTypes = groupRecord.type;
gs.info("GroupType - Assignment Group Type: " + groupTypes);
current.u_assignment_group_type = groupTypes;
gs.info("GroupType - Current Custom Assignment Group Type: " + current.u_assignment_group_type);
}
})(current, previous);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2025 06:03 AM
if field u_assignment_group_type is list type then use this
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-31-2025 06:41 AM
And it looks like I was just missing an issue with the field this entire time, since the max-length property doesn't show on the form for list types, I didn't see that it was set to 32. I increased this and now doing it manually, or using both scripts work. I'll mark your answer as correct though since it does work :D.