Error after yokohoma upgrade

GRGiri
Tera Contributor

Hi,

 

      Recently I have upgraded the instance from Washington to Yokohama patch 2.  After the upgrade, when I tried to create an incident from interaction in SOW, it showed the following error 

 

Unique Key violation detected by database ((conn=147849) Duplicate entry '9621b6cc87e12a100b62db197bbb35df-74f803c81b652610cd001fc7b04b...' for key 'interaction') ". 

 

The error popped up only once and also it did not stop me from creating the incident. The incident got created. However, currenly the dev is upgraded ad i have got prod to upgrade. I'm just worried if its gonna create an impact on prod.  Can anyone help me with this regard?. 

GRGiri_0-1747095088945.png  

I have got a skipped change to review in UI action which is related to this and have added the upgraded code to the existing script. Please see the below script.

 

var canCreateIncident = false;
if ((current.isNewRecord() && current.canCreate()) || (!current.isNewRecord() && current.canWrite()))
    canCreateIncident = current.update();
else
    canCreateIncident = true;

if (canCreateIncident) {
    var inc = new GlideRecord("incident");
    inc.initialize();
    inc.caller_id = current.opened_for;
    inc.short_description = current.short_description;
    inc.contact_type = current.type;
    inc.assignment_group = current.assignment_group;
    inc.assigned_to = current.assigned_to;
    inc.description = current.u_description.toString().substr(0,2000);
    inc.u_email_from = current.u_email_from;
    inc.u_email_cc = current.u_email_cc;

    //yokohoma upgrade script bit starts
    if (GlidePluginManager.isActive("sn_itsm_gen_ai") && current.chat_summary && (current.chat_summary.toString()).length < 4000) {
        inc.description = current.chat_summary;
    }
    inc.origin_table = "interaction";
    inc.origin_id = current.sys_id;
     //yokohoma upgrade script bit ends

    if (gs.getProperty("com.snc.incident.create_from_interaction.save") === 'true') {
        inc.work_notes = gs.getMessage('Incident created from Interaction {0}', current.number);
        var incSysId = inc.insert();
        if (incSysId) {
            var interactionRelatedGR = new GlideRecord("interaction_related_record");
            interactionRelatedGR.initialize();
            interactionRelatedGR.interaction = current.sys_id;
            interactionRelatedGR.document_table = 'incident';
            interactionRelatedGR.document_id = incSysId;
            interactionRelatedGR.insert();
        }
    }
    action.openGlideRecord(inc);
    new global.InteractionRelationshipUtil().copyAttachments(current, inc);
}

 

 

5 REPLIES 5

Maik Skoddow
Tera Patron
Tera Patron

Hi @GRGiri 

without more context information or taking a look into your instance, it's impossible to answer your question.

Maik

Ankur Bawiskar
Tera Patron
Tera Patron

@GRGiri 

Is that happening all the time?

Did you customize that OOTB new button?

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

@Ankur Bawiskar It happened only once and im unable to reproduce

@GRGiri 

is that a custom button or you updated the OOTB one?

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