What scenario would create Two duplicate Knowledge articles with same number?

barbclark
Mega Expert

I have a user who some how has created two draft Knowledge articles with the same number.       In what scenario could this happen?    

1 ACCEPTED SOLUTION

I have already deleted the duplicate , so I don't think an incident is necessary and we cannot reproduce.           This has only happened once so far as I know.      


I appreciate all of the responses.       I am going to keep an eye on this.


View solution in original post

10 REPLIES 10

Uncle Rob
Kilo Patron

I've seen this happen when exporting data between two different instances.


Export 005 from DEV and import to Prod... number remains 005, even if a record of that number already exists.


Shahed Shah1
Tera Guru

In addition to the scenario given by Robert, I've seen this happen when a user filters the Knowledge Table by the Article Number and then click New. What would usually happen when clicking New on a filtered list, is that the values are used to populate the respective fields on the form (Ref: Using Filters and Breadcrumbs - ServiceNow Wiki).



To prevent this from happening (since the Numbers are meant to be unique) a dictionary attribute was introduced: ignore_filter_on_new. Do a search on the sys_dictionary table for the Number column on the Knowledge table (name=kb_knowledge^element=number) and open up the record. Look for this attribute and make sure it is set to ignore_filter_on_new=true. If you don't find this attribute then you would want to add it to prevent a recurrence.



If it's not any of our suggestions at all, then you may want to raise an Incident with Technical Support so they can look into the logs and investigate the cause as well as assist with putting in measures to mitigate against this.


Ravi Prasad1
Tera Guru

Sometimes if user clicks multiple times on the submit button there is a possibility for duplicates.



To avoid this write task level before insert script to check for the current number. So that we can abort the duplicates.


Ravi Prasad1
Tera Guru

This is what the script is :



checkNumber();




function checkNumber()


{


//gs.log('start time of Check Duplicate BR');


  if(current.number != null)


  {


          var gr = new GlideRecord('task');  


                  gr.addQuery("number", current.number);


                  gr.query();


                  if (gr.next())


                  {


        var oldnumber = current.number;


        var old = oldnumber;


        var numstring = old.toString();


        var instanceName=gs.getProperty('glide.authenticate.sso.saml2.issuer');


                var url=instanceName+"/nav_to.do?uri=" + current.getTableName() + ".do?sysparm_query=number=" + current.number;


        gs.addInfoMessage("Ref: " + numstring + " already saved please use below link to verify");


        gs.addInfoMessage(url);


        current.setAbortAction(true);


     


                    }


  }


  else


  {


  //gs.log('number is ' + current.number);


  }


    //gs.log('end time of Check Duplicate BR');


}