Duplicate incidents are created with same incident number but different sys_id?

sahin_ponhadan
Kilo Contributor

Hi ,

 

We have a issue in our service now instance , duplicate incidents are created with same incident number for the same issue.   sys_id of these duplicate incidents are different. As an example we have one incident having   two duplicate tickets   and for another one there are 5 duplicate tickets. Till now we came across four such incidents. Client reported this by saying that "When caller/user reply to the notification (Incident INCXXXXXXX is opened on your behalf),it create another ticket with same Incident number" . But why it occured to only those four ? Whether any one faced such an issue ? What will be the cause for this?

19 REPLIES 19

Try this,


function getDuplicates() {


var dupRecords = [];


var gaDupCheck1 = new GlideAggregate('incident');


gaDupCheck1.addAggregate('COUNT', 'number');


gaDupCheck1.addNotNullQuery('number');


gaDupCheck1.groupBy('number');


gaDupCheck1.addHaving('COUNT', '>', 1);


gaDupCheck1.query();


while (gaDupCheck1.next()) {


//dupRecords.push(gaDupCheck1.number.toString());


gs.print(gaDupCheck1.number.toString() + "\n");


}


gs.print(dupRecords);


}


Thanks Vprakash, That script definitely worked to get me a list & count of numbers that have duplicates.   Now I'm working to figure out which record is the duplicate and which is the original.  


Yes, Once you delete the duplicate records you can able to mark NUMBER fields as unique at dictionary level.


After that this issue no longer happen.


shab121
Kilo Contributor

I did following steps


1) Identfed all duplicate records


2) Wrote a script to make them unique


3) enable the unique flag in DB



But still service now is generating duplicate   tickets and saving in database .


what else is required to make generated ticket number unique ?


Mahira
Tera Guru

Hi Sahin,



Can you double check your number maintenance?



Regards,


Mahira