Reassignment counter increased by 2 for single change in assignment group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
In my ServiceNow instance Reassignment counter is getting increased by 2 for single change of assignment group. This is an intermittent issue. As per ServiceNow support this is occurring due to custom "Save" button on form. Following is the condition and script for the "Save" button. Can someone help me to understand what is in the script that is causing the issue
Condition : !(current.isNewRecord() && !current.canCreate()) && current.canWrite()
Script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
Hi @Akshaykhare ,
The issue where the Reassignment counter increments by 2 instead of 1 for a single assignment group change is likely caused by how the custom "Save" button's script manages the record update and redirects.
let me explain the script how it works
for condition:- !(current.isNewRecord() && !current.canCreate()) && current.canWrite()
This checks that the record is not a new record that the user can't create, and the user has write access.
This condition ensures the save logic only runs on editable existing or new records the user can update.
action.setRedirectURL(current);
current.update();
if (!current.isActionAborted())
action.setRedirectURL(current);
action.setRedirectURL(current); sets the redirect to the current record before the update.
current.update(); performs an update on the record, which triggers Business Rules, including any Reassignment counter increments.
After update, the script again sets redirect URL if the action wasn't aborted.
causes:
On the first current.update() call, the assignment group change triggers, incrementing the counter once.
The subsequent form submit/save caused by clicking the custom Save button also commits the same change again, incrementing the counter again.
Hence, the counter increments by 2 for what is logically one change.
fix:-
Remove the explicit current.update(); inside the save button script and let the form’s normal save process handle it.
Or, add a gs.eventQueue('some_custom_event') and have an asynchronous process handle the update if needed, avoiding multiple synchronous updates.
Alternatively, prevent the default form submit from firing twice — ensure that the Save button does not cause the form to submit after the explicit update.
If your button is a UI action running on the server side for form submit, a minimal script would be:
action.setRedirectURL(current);
If you want to do additional validation or processing before save, do it without calling current.update() explicitly
If it is helpful, please hit the thumbs button and accept the correct solution by referring to this solution in the future it will be helpful to them.
Thanks & Regards,
Mohammed Mustaq Shaik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
Hi @Connectmustaq
If I remove current.update() from the script then how the data will be updated in database?
Note: User is only using this "Save" button (UI action) to update the task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
Hi @Akshaykhare ,
Oh, if the user is using the Save button, I need to check that. Let me do some analysis and I'll get back to you.
Thanks,
Mohammed Mustaq Shaik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
Since ServiceNow already informed the issue, please do what they are suggesting
💡 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
