logo

NJP

Change Management - Lead Times

Import · Mar 03, 2020 · article

When implementing Change Management you're always going to need to calculate Lead Time for a Change to be implemented.

Lead Time means how much time (in terms of days) are in advance before a Change can be implemented.

Key factors are Planned Start Date, Priority and Change Type. Depending on customer requirements and change management process there will be other factors to consider but for now let's focus on how to calculate lead time.

image

The Formula

Here is an example on how to calculate the Lead Time.

var changePlannedStartDate = "2020-03-29 15:00:00";
var date1 = new GlideDateTime(changePlannedStartDate);
var date2 = new GlideDateTime(gs.nowDateTime());

// ge the difference in terms of number of days elapse between two dates
// returns days in format: ddd hh:mm:ss
var diff = gs.dateDiff(date1.getDisplayValue(), date2.getDisplayValue(), false);
// obtains only number of days
// if diff has a length of 8 characters then it's only hours difference meaning 0 days lead time
var daysDiff = diff.length == 8 ? 0 : parseInt(diff.slice(0,-8));

// make it a positive number
if(daysDiff < 0) daysDiff = -1 * daysDiff;

Now with the Lead Time calculated you may do different things:

  • Display a custom message in the Change form to let know the requester that there's no sufficient lead time to continue with the planned schedule.
  • You may automatically change the type of the Change; say for example from Normal to Emergency
  • Perhaps additional approvals are needed for so short notice.

Oscar Lopez

@oslovanet

View original source

https://www.servicenow.com/community/itsm-articles/change-management-lead-times/ta-p/2299624