Sidebar

Using iTop

Creating your iTop

iTop Customization

"How to" examples
DataModel

User Interface

Automation & Ticket management

Portal Customization

Use an holiday calendar per country for SLA computation

Prerequisite: You must be familiar with the Syntax used in Tutorials and have already created an extension.

learning:
Use an holiday calendar per country for SLA computation
level:
Intermediate
domains:
XML, SLA, Coverage Windows, Holidays
min version:
2.3.0

This tutorial will explain

  1. How to add a link to Holidays Calendar in Coverage Windows
  2. How to change SLA computation to take Holidays in account

First of all you need to install SLA considering business hours

For adding holidaycalendar_id on CoverageWindow class, start with this:

itop_design
  <classes>
    <class id="CoverageWindow" _created_in="combodo-sla-computation" _delta="must_exist">
      <fields>
        <field id="holidaycalendar_id" xsi:type="AttributeExternalKey" _delta="define">
          <sql>holidaycalendar_id</sql>
          <filter>SELECT HolidayCalendar</filter>
          <dependencies/>
          <is_null_allowed>true</is_null_allowed>
          <target_class>HolidayCalendar</target_class>
          <on_target_delete>DEL_MANUAL</on_target_delete>
        </field>
        <field id="holidaycalendar_name" xsi:type="AttributeExternalField" _delta="define">
          <extkey_attcode>holidaycalendar_id</extkey_attcode>
          <target_attcode>name</target_attcode>
        </field>
      </fields>
      <presentation>
        <details _delta="redefine">
          <items>
            <item id="name">
              <rank>10</rank>
            </item>
            <item id="description">
              <rank>20</rank>
            </item>
            <item id="holidaycalendar_id">
              <rank>30</rank>
            </item>
          </items>
        </details>
      </presentation>
    </class>
  </classes>
  <dictionaries>
    <dictionary id="EN US" _delta="must_exist">
      <entries>
        <entry id="Class:CoverageWindow/Attribute:holidaycalendar_id" _delta="define"><![CDATA[Holiday calendar ]]></entry>
        <entry id="Class:CoverageWindow/Attribute:holidaycalendar_id+" _delta="define"><![CDATA[]]></entry>
        <entry id="Class:CoverageWindow/Attribute:holidaycalendar_name" _delta="define"><![CDATA[Holiday calendar name]]></entry>
        <entry id="Class:CoverageWindow/Attribute:holidaycalendar_name+" _delta="define"><![CDATA[]]></entry>
      </entries>
    </dictionary>
  </dictionaries>

Change SLA computation to take Holidays in account

To change SLA computation, adjust the holidays_oql parameter in the Configuration File of your iTop instance like this:

   'combodo-sla-computation' => array (
      'coverage_oql' => 
         'SELECT CoverageWindow AS cw 
          JOIN lnkCustomerContractToService AS l1 ON l1.coveragewindow_id = cw.id 
          JOIN CustomerContract AS cc ON l1.customercontract_id = cc.id 
          WHERE cc.org_id= :this->org_id AND l1.service_id = :this->service_id',
      'holidays_oql' => 
         'SELECT Holiday AS h 
          JOIN HolidayCalendar AS hc ON h.calendar_id=hc.id 
          JOIN CoverageWindow AS cw ON cw.holidaycalendar_id=hc.id 
          JOIN lnkCustomerContractToService AS l1 ON l1.coveragewindow_id=cw.id 
          JOIN CustomerContract AS cc ON l1.customercontract_id=cc.id 
          WHERE cc.org_id = :this->org_id  AND  l1.service_id= :this->service_id',
    ),

Create your holidays and holidays calendar managing holidays. Join them to your coverage windows and ajust your customers contracts.

You can defined yours calendars by country, team, customer….

latest/customization/multiple-holiday-calendar.txt · Last modified: 2024/09/10 10:25 by 127.0.0.1
Back to top
Contact us