add template in inbound email action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Monday
Hi everyone,
I'm working on an Inbound Email Action that creates incidents. I want to apply a predefined Incident Template to populate default values like category, urgency, impact, assignment group, etc.
script:
while script subject and caller field is populated from email. but from template it is not updated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Monday
there is already another OOTB New Type Inbound action on incident.
Is that deactivated?
Also in your new inbound action you should use current object and not GlideRecord and why to update it
Since you are using GlideRecord it's inserting 1 with current object and another with GlideRecord object
Please use current object, something like this please enhance
var userMatch = body.match(/Created \/ User\s *: \s*[\d\/\s]+\/\s*(\w+)/);
var callerId = userMatch ? userMatch[1] : '';
var t = new GlideTemplate.get('template sysid');
t.apply(current);
current.caller_id = callerId;
current.work_notes = "Original email:\n" + body;
current.insert();
💡 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
