Inbound action for In-Reply-To header
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I have a requirement that if any user sends an email to servicenow in csm it should create a case. If someother team member also reply/forward the same email to servicenow, it should again create a new case. when first time email comes it create a case, next time someone else reply to same email it is updating the same case instead of creating new. ALthough that email don't contain any watermark or case number in subject/body.
getting below entry in email logs
Received id=<CH2PR05MB7077105434B6DBE4DDA69C12E4102@CH2PR05MB7077.xxxxx.prod.outlook.com> Classified as reply to 'CS0001774' found via In-Reply-To header
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hey @Hafsa1
The behavior you're seeing is expected based on the email log entry:
Received id=... Classified as reply to 'CS0001774' found via In-Reply-To header
This indicates that ServiceNow is identifying the incoming email as part of an existing email conversation using the In-Reply-To header rather than a watermark or case number.
Why the Existing Case Is Being Updated
ServiceNow uses multiple mechanisms to correlate inbound emails with existing records:
Watermark
Record Number (e.g., CS0001774)
Email Headers
In-Reply-To
References
In your scenario:
User A sends an email to ServiceNow.
A new CSM Case is created.
Another team member replies to or forwards the same email thread.
Outlook/Exchange preserves the original email headers.
ServiceNow finds a matching In-Reply-To header and associates the email with the existing Case.
The existing Case is updated instead of creating a new one.
How to Verify
Navigate to:
System Mailboxes > Inbound > Received
Open both the original and subsequent emails and compare:
Message-ID
In-Reply-To
References
You will likely find that the second email contains references to the original email thread, causing the correlation.
Recommended Approach
If the business requirement is:
Every inbound email should create a new Case, even if it originates from an existing email thread.
Then a custom inbound email handling approach is required.
Example Inbound Email Action:
Type: New
Target Table: Case [sn_customerservice_case]
Script:
(function runAction(current, event, email, logger) {
var caseGR = new GlideRecord('sn_customerservice_case');
caseGR.initialize();
caseGR.short_description = email.subject;
caseGR.description = email.body_text;
// Find contact based on sender email
var userGR = new GlideRecord('sys_user');
userGR.addQuery('email', email.origemail);
userGR.query();
if (userGR.next()) {
caseGR.contact = userGR.sys_id;
}
var caseSysId = caseGR.insert();
logger.log("Created new Case: " + caseGR.number);
})(current, event, email, logger);Important Note
The above script creates a new Case when the inbound email action executes. However, in your situation the email is already being classified as a reply before the inbound action is reached:
Classified as reply to 'CS0001774' found via In-Reply-To header
Therefore, simply creating a new inbound email action may not fully resolve the issue because the email threading logic has already correlated the email to an existing Case.
Additional Options
Depending on your business requirements, consider:
Creating new Cases only for forwarded emails (FW/FWD).
Using a dedicated mailbox for new Case creation.
Modifying the email routing process to remove In-Reply-To and References headers before emails reach ServiceNow.
Implementing custom inbound email processing to bypass standard thread correlation.
********************************************************************************************************************************
If this response helps, please mark it as Accept as Solution and Helpful.
Doing so helps others in the community and encourages me to keep contributing.
Regards
Vaishali Singh
Servicenow Developer
Linkedin - https://www.linkedin.com/in/vaishali-singh-2273361bb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hey @Hafsa1
Hope you are doing well.
Did my previous reply answer your question?
If it was helpful, please mark it as correct ✓ and close the thread . This will help other readers find the solution more easily.
Thankyou & Regards
Vaishali Singh
Servicenow Developer
Linkedin - https://www.linkedin.com/in/vaishali-singh-2273361bb