The CreatorCon Call for Content is officially open! Get started here.

Maintenance Window

sunny13
Giga Expert

Hi All,

I would like to know what is the purpose of a Maintenance Window ?

Today in SN if a Change Request is scheduled outside of a Maintenance Maintenance window it shows up as a conflict with Type of "Not in a Maintenance Window" I would like to show the type where the Conflict is "In a Maintenance window" or what other Options there are as far as the type of conflict.

Thnaks for your support.

12 REPLIES 12

Hi Michael,



I would like to understand how to show them as a separate related list .


I want to show "In Maintenance Window" items in a separate related list or along with the conflict related list.


can you please navigate me how to achieve this in the instance.


Or else the easiest way is please let me know a scenario to replicate so that i will get "In Maintenance Window" in my related list status of conflict.


The problem we have is that we have multiple schedules and the CI's are not linked to a specific schedule.   So what happens is there are always conflicts.   So a CR has like 7 schedules we check against and it conflicts with 6, meaning that it has no conflict with the 7th schedule and therefore is within that 7th scheduled window.



So instead of telling people what Schedules that are NOT (conflicts with) in, I want to be able to show them which schedule that ARE in (Does not Conflict with)


Hi Sajin,



I don't think this is out-of-the-box so you would need to enhance existing logic in script include "ChangeCheckConflicts". You can find method in there called "stageB" that is handling Not in Maintenance Window conflicts. There is if statement which then calls "_addConflict" method and you would just add "else" branch where you would create another record indicating that Change passed that maintenance window.


From what I understood the requirement, you could even try to change the logic completely so that passing one maintenance window would be enough to not have a change marked as "conflict exists", but that would require bigger change to the script.



      stageB: function(ciGR) {


              if (!ChangeCollisionHelper.isDateInCiMaintenanceWindows(this.startDate, this.endDate, ciGR.maintenance_schedule))


                      this._addConflict(ciGR.sys_id, ChangeConflict.CHANGETYPE_NOT_IN_WINDOW, ciGR.maintenance_schedule);


// here you can place else branch with your custom logic to handle the case when change is in maint window



              for (var j = 0; j < this.maintenanceSchedules.length; j++) {


                      var schedule = this.maintenanceSchedules[j];




                      if (!this._doesScheduleApplyToCi(schedule.applies_to, ciGR.sys_class_name) || this.dateInCiMaintenanceWindows[schedule.sys_id])


                              continue;




                      if (JSUtil.nil(schedule.condition) || SNC.Filter.checkRecord(ciGR, schedule.condition, true, this.bFilterCaseSensitive))


                              this._addConflict(ciGR.sys_id, ChangeConflict.CHANGETYPE_NOT_IN_WINDOW, schedule.sys_id);


// here you can place else branch with your custom logic to handle the case when change is in maint window


              }


      },



This code is from Helsinki version. If you are on different release, it may differ little bit.


Hey thanks buddy it is very helpful.