how to fetch the case number in subject line of the inbound email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2025 11:36 PM
ServiceNow client leveraging the Case Management needs to automate Escalating Inbound email handling to ensure a case can be escalated just via replying to an email sent from the system to their inbox. For any inbound email coming with a specific subject line i.e., ‘Escalate Case for Caller <Case Number>’ should be escalated. Evaluate whether there is an active Case number in the system with that number, if so:
- Change the state of the case to ‘Awaiting Info’.
- Send an approval request to the Manager of the Assignment group.
- If rejected:
- mark the status of the case back to ‘Open’ and
- send an email to Consumer with Subject line: ‘Your request for escalation was rejected’.
- If the approval was approved:
- Add a comment in the work notes stating, ‘This case has been escalated as per request from caller with approval’.
- Create an Escalation (sn_customerservice_escalation) record within ServiceNow linking it with the original case.
- Update the comment from body of the email to this escalation case work notes.
- Send email to Consumer stating – ‘Your case has been escalated <Escalation Number>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2025 12:52 AM
Hello @ShruthiMR ,
Suppose the Escalation number is of 10 chars and the subject line is "Escalate Case for Caller ESC0000023", Then use below code to get the Escalation number :
var number = email.subject.substring(email.subject.indexOf('Caller')+7,37);
If this solution helped resolve your issue, please consider marking it as helpful or correct.
This will assist others in finding the solution faster and close the thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2025 01:41 AM
Will this be a reply type email or new email?
If it's reply type your existing inbound action can be updated to handle this logic.
what did you start with and where are you stuck?
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 03:47 AM
existing inbound email action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 04:06 AM
if existing the what script did you update as per your requirement?
share that updated script.
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