Create Incident : did not create or update incident using current

Nilesh Pol
Tera Guru
Hi all, Im trying to create an incident with the verification of a entry of the u_redirect_email in custom table, but I am getting an error message: "Create Incident : did not create or update incident using current"
 
any suggestion will be appreatiated.
 
action type: new, and script:
 
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";
        current.insert();
    }
7 REPLIES 7

Mark Manders
Mega Patron

Has the sender access to the custom table? Inbound email is handled as a sort of impersonation. So if the user can't read the custom table, nothing is done, because he doesn't have access. 

What logs do you have?


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Ankur Bawiskar
Tera Patron
Tera Patron

@Nilesh Pol 

did your inbound email action get processed?

what came in logs?

Seems your inbound email action is on incident table so the user who is replying has Create, Update access to incident?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Nilesh Pol
Tera Guru

Hi @Mark Manders Yes, User can have access, and As admin I can also see same error msg.

Hi @Ankur Bawiskar The script is written on incident as target to create incident.  we verify the email properties and tested POP3 account as successful. I am doing analysis as admin even, in email log we did not receiving the email since I am sending email to an email address that has entry in the custom table. 

 

@Nilesh Pol 

In email logs when that email is received, did you check in related list which all inbound email actions triggered and which were skipped, processed?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader