- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2017 08:35 AM
We noticed recently that our Incident numbers have grown beyond the halfway point of six-figures. What happens when our Incident number reaches 999999? Do we roll into 1000000?
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2017 09:30 AM
When you get to the end of your six digit numbering, the incident that follows INC999999 is INC1000000. The number will continue, it will just be a little longer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2018 04:51 AM
Hi Chuck,
Yes, I changed the number from 6 to 7 but I am not able to sort by Number field.
If you order ascending, you will end up with a list of tickets starting with the tickets created most recent after the 1,000,000 mark… and over time the current tickets will just get further and further away. And if you order the view descending, you will end up with "INC1…" at the end of your list which isn't helpful either.
Thanks,
Neeta Patil

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2018 05:02 AM
You'll need to renumber all the old records then. I remember doing this years ago when I was a customer. The script went something like this - note, you'll want to test this in scripts - background first on a few DEV records (which is why the setLimit(5) is in there). For a million records, this could take a while.
var incGr = new GlideRecord('incident');
incGr.setLimit(5);
incGr.query();
while (incGr.next()) {
incGr.setWorkflow(false);
incGr.autoSysFields(false);
incGr.forceUpdate(true);
incNum = incGr.getValue('number');
incNum = incNum.replace('INC', ''); // strip off the INC
var newNum = pad(incNum, 7); // Make a 7 digit count w/padded 0s
inc.number = 'INC' + newNum;
inc.update();
}
function pad(n, width, z) {
z = z || '0';
n = n + '';
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
}