Had this requirement the other day regarding Change Freeze dates. The customer wanted to warn technicians raising changes that their scheduled change dates fell into their upcoming annual change freeze window.

As a quick fix, we added the following script to their default Change Template as a Field & Form On Form Load rule to prompt the Technicians with a warning if this was the case:

Script Code

var start_freeze_window = new Date("20 Dec 2017, 15:23:00");
var end_freeze_window = new Date("02 Jan 2018, 15:23:00");


if(
  ($CS.getValue("SCHEDULEDSTARTTIME").getTime() <= end_freeze_window.getTime() && 
   $CS.getValue("SCHEDULEDSTARTTIME").getTime() >= start_freeze_window.getTime())
)   
{
    alert("Start date falls during change freeze.");
    /*stop form submission*/
    $CS.stopFormSubmission();


}
else if(
  ($CS.getValue("SCHEDULEDENDTIME").getTime() <= end_freeze_window.getTime() && 
   $CS.getValue("SCHEDULEDENDTIME").getTime() >= start_freeze_window.getTime())
)   
{
    alert("End date falls during change freeze.");
    /*stop form submission*/
    $CS.stopFormSubmission();


}
else if ($CS.getValue("SCHEDULEDSTARTTIME").getTime() <= start_freeze_window.getTime() && 
   $CS.getValue("SCHEDULEDENDTIME").getTime() >= end_freeze_window.getTime())
{
    alert("Change freeze period during scheduled dates.");
    /*stop form submission*/
    $CS.stopFormSubmission();  
} 

Obviously this only deals with a single upcoming date range based on values defined in the script variables.

If I was to take this further I’d probably look at the possibility of using the Change Custom Triggers to action an external script to look up the current Change Freeze dates from a Change Freeze record in ManageEngine ServiceDesk Plus (via the API) or perhaps performing an external lookup of dates.

One for another time … ;0)

Enjoy!

This article is relevant to:
Service Desk

You may be interested in these other recent articles

Increase your Office 365 Security Score

1 February 2019

As you may know, the Office 365 Secure Score is an indication of how secure your current Office 365 environment is compared to the possible…

Read more

Sending An Email Notification For A Specific Template In ServiceDesk Plus

16 October 2018

Sometimes it’s handy to know when users might have raised a request using a specific template from the self-service portal. You might even need this…

Read more

Restoring the Old Self-Service Icons in the New ServiceDesk Plus

5 October 2018

As you may be aware the recent ServiceDesk Plus version 9418 update brought various changes, most notably revamped UI and new self-service portal customisation options.…

Read more

Find Out If An Expired Asset Reappears with ServiceDesk Plus and AssetExplorer – Part 1

4 October 2018

As part of the asset management lifecycle, you would change the Asset State in ManageEngine ServiceDesk Plus or AssetExplorer to reflect if an asset has…

Read more

When you really need a useful description in ServiceDesk Plus

27 September 2018

Do you often struggle to get your service team to enter meaningful information into a request description other than ‘Done’ or a copy and paste of…

Read more