Create Incident : did not create or update incident using current
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2025 03:28 AM - edited 07-15-2025 03:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2025 06:08 AM
@Ankur Bawiskar yes its "Processed" state and error in the log is Create Incident : did not create or update incident using current.
Did anyone know how email domain managed in the instance. I can see there are emails getting received in email logs from some domain only i.e. @example.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2025 06:35 AM
can you add this line and see if that user is able to create?
var userQuery = 'active=true^locked_out=false^emailISNOTEMPTY^u_external_idISNOTEMPTY^email=' + email.origemail;
var grUser = new GlideRecord('sys_user');
grUser.addEncodedQuery(userQuery);
grUser.query();
if (grUser.next()) {
gs.log('User id of the sender met the requirements: ' + email.origemail, 'Inbound Email Action: Create Incident');
var mailQuery = 'u_active=true^u_redirect_addressIN' + email.direct;
var mrQuery = new GlideRecord('u_email_to_incident_configuration');
mrQuery.addEncodedQuery(mailQuery);
mrQuery.query();
if (mrQuery.next() && email.subject != '' && email.body_text != '') { /
gs.log('Redirect MailBox is available in the table: ' + email.direct, 'Inbound Email Action: Create Incident');
current.cmdb_ci = mrQuery.u_business_service;
current.assignment_group = mrQuery.u_assignment_group;
current.u_creator_group = mrQuery.u_creator_group;
current.priority = mrQuery.u_priority;
current.service_offering = mrQuery.u_service_offering;
current.caller_id = grUser.sys_id;
current.short_description = email.subject;
current.opened_at = gs.nowDateTime();
current.u_outage_begin = gs.nowDateTime();
current.work_notes = "Incident created via Redirected email:-" + "\n\n" + email.body_text;
current.u_contact = grUser.sys_id;
current.state = 2;
current.contact_type = "email";
gs.info("user can create" + current.canCreate());
current.insert();
}
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
07-15-2025 07:43 AM
@Nilesh Pol Instead of current.insert() Can you try doing a fresh GlideRecord and see if that works
var inc = new GlideRecord('incident');
inc.initialize();
inc.cmdb_ci = mrQuery.u_business_service;
inc.assignment_group = mrQuery.u_assignment_group;
inc.u_creator_group = mrQuery.u_creator_group;
inc.priority = mrQuery.u_priority;
inc.service_offering = mrQuery.u_service_offering;
inc.caller_id = grUser.sys_id;
inc.short_description = email.subject;
inc.opened_at = gs.nowDateTime();
inc.u_outage_begin = gs.nowDateTime();
inc.work_notes = "Incident created via Redirected email:-" + "\n\n" + email.body_text;
inc.u_contact = grUser.sys_id;
inc.state = 2;
inc.contact_type = "email";
var incID = inc.insert();
if (!incID) {
gs.info("Failed to insert incident record", "Inbound Email Action");
} else {
gs.info("Incident created with sys_id: " + incID, "Inbound Email Action");
}
Please mark correct/helpful if that helps you, thanks!