Duplicate incidents are created with same incident number but different sys_id?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2014 06:43 AM
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?
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2014 11:50 PM
Hi Sahin,
We had a similar issue at a client after Calgary update. How we efixed it is by cleaning up all duplicate entries and then updating the number field on the number maintenance record for that table. The number should be either greater than or equal to the highest number in the incident list ; for eg if your highest incident number is INC176601 then update the number field in the number maintenance record for incident to 176601 . Hope this helps
Regards,
Mahira
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2014 12:40 AM
Hi Mahira ,
for me cleaning up is not option . I need to assign them new numbers .
I picked up highest available number and updated records by incrementing one at a time .
so new records are like INC00092,INC00093,INC00094,INC00095,INC00096.
then I tried to create a new incident from UI , they not only gets numbers as INC00092,INC00093,INC00094,INC00095,INC00096
but also getting saved , although unique attribute is enabled in Dictionary .
-Shabbir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2014 01:57 AM
Hi Shabbir,,
What is the current number in your number maintenance record for incident table?
Regards,
Mahira
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2014 02:39 AM
Hi Shabbir,
By Number maintenance I mean to go to the Number Maintenance module on the left hand navigation area.
I haven't tried this but my thoughts on your course of action should be
1)Assign new incident numbers to the duplicate records since you cannot delete them
2) Change the number maintenance number (by going to left handside module) to the highest number
3)start creating new incidents from the UI
Regards,
Mahira
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2014 09:24 PM
Hi Mahira ,
We have used this script to fox the issue .
===========================
var typeSearchFor = 'incident';
var records = [];
records = getDuplicates(typeSearchFor);
var duplicateRecordIndex;
for (duplicateRecordIndex = 0; duplicateRecordIndex < records.length; duplicateRecordIndex++)
{
gs.print(records[duplicateRecordIndex]);
update(records[duplicateRecordIndex]);
}
function getDuplicates(type) {
var dupRecords = [];
var gaDupCheck1 = new GlideAggregate(type);
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("getDuplicates Type" + type + " : " + gaDupCheck1.number.toString() + "\n");
}
return dupRecords;
}
function update(candidate) {
var rec = new GlideRecord(typeSearchFor );
rec.addQuery('number', candidate);
rec.query();
var count = rec.getRowCount();
gs.print( candidate+" "+ typeSearchFor +'count' + count);
var index = 0;
while (rec.next()){
if (index == 0){
gs.print("no change " + rec.number); index++; continue;
}
var newNumber = GlideNumberManager.getNumber(typeSearchFor);
gs.print(rec.number + ': changeded incident number : ' + newNumber);
rec.number = newNumber;
rec.update();
index++;
}
}