- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 10:47 AM
We have a situation where a team needs to report on how many times their Incidents have been reassigned. So, I have added a custom field to the Incident table named u_assignment_group_count. I am now working on a Business Rule to maintain that counter.
Here are the conditions on which that new field should be updated:
- Category is "Workday"
- Assignment Group field value is changed/updated
It should NOT run if fields other than the Assignment Group are changed (and the Assignment Group field remains the same).
So, here is how I set up the conditions:
And then I created script on the Advanced tab to increment the new field by 1, like this:
However, when I submit a record, and try to change the Assignment Group, ServiceNow just hangs, and never finished update unless I click "Cancel" on the timer counter that pops up. I think it is getting caught in a recursive loop. If I disable the rule, it updates immediately with no issue. So I suspect their is an issue with how I set up the Business Rule.
How can I adjust my Business Rule to work the way I want it to, and not hang up?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 11:04 AM
You don't need to do a GlideRecord in a BR to lookup the current record - just use 'current.field_name' to get or set a value. You should also do this before Update, and remove the update() line. Since you didn't mention it, are you aware of the reassignment_count field that is already doing this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 11:04 AM
You don't need to do a GlideRecord in a BR to lookup the current record - just use 'current.field_name' to get or set a value. You should also do this before Update, and remove the update() line. Since you didn't mention it, are you aware of the reassignment_count field that is already doing this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 11:15 AM
No, I was not aware of that field! That is awesome! That is exactly what I need.
I guess I don't need this Business Rule after all.
Thank you very much!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 11:05 AM - edited 03-25-2025 11:12 AM
Hi @jmiskey ,
if (current.assignment_group.changes() && current.assignment_group) {
current.u_assignment_group_count += 1;
}
make it a Before insert/update BR with above script .
isn't this functionality already exist with task level with reassignment_count field?
you want to track the changes of workday category separately is it?
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya