Duplicate HR Case Getting Created
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 12:47 AM
Hello Everyone,
I’m facing an issue where a duplicate HR Case is being created automatically when a case is generated via an Inbound Email Action.
Here’s the scenario:
A user sends an email.
The Inbound Action processes the email and creates the expected HR Case (with subject, description, and correct assignment group).
However, at the exact same timestamp, a second HR Case is created with:
No subject or description
Assignment group = some group we’re not using anywhere in our current logic
Created and Created by fields match exactly with the first case
I checked:
Email logs – only the primary case is logged
System logs – no useful entries for the second case
Can Anyone suggest me on this , from where to configure this and which this is being getting triggered or created.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 12:50 AM
Hello @mdshahvez11 ,
Please check if you are using current.update method in any script.
Thank you.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 01:04 AM - edited 07-07-2025 01:05 AM
Yes, we have two Inbound Email Actions, and both of them use current.update().
Here’s what they do:
When a reply is received on an existing HR case, we update the state — for example:
From On Hold → In Progress
From Resolved → In Progress
We also append the email body to the case’s comments field
Then we call **current.update()** to save these changes
However, we’ve observed that the extra HR case is being created at the very beginning, when the state of the original case is still New.
The state only transitions to In Progress after the ticket is assigned to someone.
(function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
// Implement email action here
gs.include('validators');
if (current.getTableName() == "sn_hr_core_case") {
var gr = current;
gr.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
if (email.body.assign != undefined)
gr.assigned_to = email.body.assign;
if (gr.state == 8{
gr.state = 18;
}
gr.update();
}
})(current, event, email, logger, classifier);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 01:16 AM
Check all these possibilities to see where the issue comes from -
Deactivate this Inbound Action for testing to see if it creates a duplicate case.
Check for any other custom business rules that might be involved.
Review other HR Case Inbound Actions for potential conflicts or effects.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 12:54 AM
is that inbound email action a custom or OOTB one?
any business rule has current.insert() on your HR case table.
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