On January 1, 2020 a lot of people will wake up with a headache. While some will be due to the previous night's activities, others will be due to a disappearing Knowledge Base, and a lack of systematic delegation.

What is KB-pocalypse?

ServiceNow's default date value has always been set to 2020-01-01. While this was a good 'future' date to use, the future is now here! This means that some records won't be viewed as valid once the new year begins.

Some examples are:

  • Delegates: Delegate records have a default 'ends' date of 2020-01-01. All delegations with this end date will no longer be active.
  • Knowledge Base: If your knowledge articles have a Valid to (valid_to) date of 2020-01-01, then they won't be visible to anybody searching for them through the Service Portal, or searching/browsing the Knowledge homepage.

How can I see if this impacts me?

Running the script below will show you what tables still have this default value, and how many records still have a date of 2020-01-01.

This script will find all dictionary entries that are using 2020-01-01 as a default date, and tell you the number of impacted records. 

To actually make changes, you will want to change the update flag to true;


//change this flag to true if you want to update the dictionary entries and affected records
var update = false; 

//Update this value as yyyy-mm-dd
var newDefaultDate = "2030-01-01"; 

var gd = new GlideDate(); 

var gdt = new GlideDate(); 
gdt.setValue(newDefaultDate+' 23:59:59'); 

    gs.print("Since the update flag is false, we are not making upates to these records.");

var dictionaryEntry = new GlideRecord("sys_dictionary");
    var table = new GlideRecord(dictionaryEntry.name.toString());
        gs.print("There are "+table.getRowCount()+ " "+dictionaryEntry.name.toString()+" records with a "+dictionaryEntry.element.toString()+" date of 2020-01-01");
            var newDate  = dictionaryEntry.internal_type == "glide_date" ? gd.getDisplayValue() : gdt.getDisplayValue();
                table.setValue(dictionaryEntry.element.toString(), newDate);
    } else{
        gs.print("The "+dictionaryEntry.name.toString()+" table still has this default value, but doesn't have any records.");

        dictionaryEntry.default_value = dictionaryEntry.default_value.replace(/2020-01-01/gi, newDefaultDate);

Also available on GitHub.

How can I fix it?

You can fix this by completing the following:

  1. Change all the affected records as identified above
  2. Updating the dictionary entry so that future records won't still default to 2020-01-01.

Please note that the above script will do this for you if you change the update flag to true.


Toby Comer

Senior Technical Architect