Restricting change implementation during change freeze period
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2018 09:39 PM
Hi Team,
I have a requirement where I have to restrict change implementation during change freeze period.
I have Planned start date and Planned end date fields on Change form. And also I have a schedule defined for Change freeze.
Now my requirement is the implement the code such that duration between planned start date and planned end date should not fall in the change freeze schedule period.
I was able to implement the code for checking if the Planned start/Planned end date is falling in the change freeze schedule. But, I need help in checking if the duration between planned start and planned end dates is falling in the change freeze period. If it is falling then it should throw error and I should not be able to save the ticket. Otherwise the ticket should be saved.
Please help me with any ideas
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2018 09:50 PM
Hello,
Are you using the Conflict Checker on Change? You can set up maintenance or blackout windows and the conflict detector would do it for you automatically. Once it is setup, you can add a validation to abort implementation during the conflict period.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2018 10:01 PM
Client does not want to use conflicts checking functionality. They wants it to be done based on duration between planned start and planned end date only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2018 10:11 PM
Can you try this and see if it fetches you the required duration within scheduled?
var gsBusiness = new GlideSchedule('1524c5d40f0cb100465d46ace1050ed3'); //sysid of schedule
var duration = gsBusiness.duration(current.planned_start.getGlideObject(), current.planned_end.getGlideObject());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2018 09:53 PM
Could you try something like checking if the start date is smaller than the freeze start and the end date is larger than freeze end?
something like if ( plannedStart < freezeStart && plannedEnd > freezeEnd)
Then the freeze would be within the planned and end times.