cmdbAbstractObject bizmodel,searchable true autoincrement ticket id finalclass ref true title false description false ticket_log true start_date false lnkTicketToDoc ticket_id 0 0 document_id lnkTicketToCI ticket_id 0 0 ci_id lnkTicketToContact ticket_id 0 0 contact_id lnkTicketToIncident ticket_id 0 0 incident_id
10 20 30 40 50 60 70 80
10 20 30 40 10 20 30 40 50
Ticket bizmodel true autoincrement ticket_response id new assigned frozen escalated_tto escalated_ttr resolved closed status new false org_id]]> caller_id Person true DEL_MANUAL caller_id email org_id Organization false DEL_AUTO org_id name org_id]]> service_id Service false DEL_MANUAL service_id name service_id]]> servicesubcategory_id ServiceSubcategory false DEL_MANUAL servicesubcategory_id name product true 1 2 3 impact 1 false 1 2 3 urgency 1 false 1 2 3 priority 1 false service_id AND cc.org_id = :this->org_id]]> workgroup_id Team false DEL_MANUAL workgroup_id name workgroup_id]]> agent_id Person true DEL_MANUAL agent_id name agent_id email related_problem_id Problem true DEL_MANUAL related_problem_id ref related_change_id Change true DEL_MANUAL related_change_id ref close_date true last_update true assignment_date true resolution_date true tto_escalation_deadline true ttr_escalation_deadline true closure_deadline true fixed duplicate couldnotreproduce irrelevant resolution_code fixed true solution true 1 2 3 4 user_satisfaction 1 true user_commment true status ev_assign assigned SetAssignedDate ev_timeout escalated_tto ev_assign assigned SetAssignedDate ev_reassign assigned ev_timeout escalated_ttr ev_resolve resolved SetResolveDate SetClosureDeadline ev_reassign escalated_ttr ev_resolve resolved SetResolveDate SetClosureDeadline ev_reassign assigned ev_close closed SetClosureDate false public LifecycleAction Set('closure_deadline', time() + $iMaxWaitHours * 3600); return true; }]]> false public LifecycleAction Set('assignment_date', time()); return true; }]]> false public LifecycleAction Set('resolution_date', time()); return true; }]]> false public LifecycleAction Set('close_date', time()); return true; }]]> name of the SLT selected, 'value' => duration in seconds of the SLT metric, null if no SLT applies to this ticket */]]> false public LifecycleAction $this->Get('priority'), 'service_id' => $this->Get('service_id'), 'metric' => $sMetric, 'org_id' => $this->Get('org_id'), ) ); $iMinDuration = PHP_INT_MAX; $sSLTName = ''; while($oSLT = $oSLTSet->Fetch()) { $iDuration = (int)$oSLT->Get('value'); $sUnit = $oSLT->Get('value_unit'); //echo "

Found SLT: ".$oSLT->GetName()." - $iDuration ($sUnit)

\n"; switch($sUnit) { case 'days': $iDuration = $iDuration * 24; // 24 hours in 1 days // Fall though case 'hours': $iDuration = $iDuration * 60; // 60 minutes in 1 hour // Fall though case 'minutes': $iDuration = $iDuration * 60; } if ($iDuration < $iMinDuration) { $iMinDuration = $iDuration; $sSLTName = $oSLT->GetName(); } } if ($iMinDuration == PHP_INT_MAX) { $aResult = null; } else { $aResult = array('SLT' => $sSLTName, 'value' => $iMinDuration); } } return $aResult; }]]>
/** * Compute the priority of the ticket based on its impact and urgency * @return integer The priority of the ticket 1(high) .. 3(low) */ false public LifecycleAction array( 1 => 1, 2 => 1, 3 => 2, ), // a group 2 => array( 1 => 1, 2 => 2, 3 => 3, ), // a departement! 3 => array( 1 => 2, 2 => 3, 3 => 3, ), ); $iPriority = 1; if (isset($aPriorities[(int)$this->Get('impact')][(int)$this->Get('urgency')])) { $iPriority = $aPriorities[(int)$this->Get('impact')][(int)$this->Get('urgency')]; } return $iPriority; }]]> false public Overload-DBObject Set('priority', $this->ComputePriority()); // Compute the SLA deadlines, if any is applicable to this ticket $aSLT = $this->ComputeSLT('TTO'); if ($aSLT != null) { $oStartDate = new DateTime($this->Get('start_date')); $oDeadline = SLAComputation::GetDeadline($this, $aSLT['value'], $oStartDate); $this->Set('tto_escalation_deadline', $oDeadline->format('U')); } else { $this->Set('tto_escalation_deadline', null); } $aSLT = $this->ComputeSLT('TTR'); if ($aSLT != null) { $oStartDate = new DateTime($this->Get('start_date')); $oDeadline = SLAComputation::GetDeadline($this, $aSLT['value'], $oStartDate); $this->Set('ttr_escalation_deadline', $oDeadline->format('U')); } else { $this->Set('ttr_escalation_deadline', null); } }]]> false public Overload-iDisplay GetState()) { case 'new': $oEscalationDeadline = $this->Get('tto_escalation_deadline'); if ($oEscalationDeadline != null) { // A SLA is running $iStartDate = AttributeDateTime::GetAsUnixSeconds($this->Get('start_date')); $iEscalationDeadline = AttributeDateTime::GetAsUnixSeconds($oEscalationDeadline); $ratio = ($iEscalationDeadline - time())/($iEscalationDeadline - $iStartDate); if ($ratio <= 0) { $sHilightClass = HILIGHT_CLASS_CRITICAL; } else if ($ratio <= 0.25) { $sHilightClass = HILIGHT_CLASS_WARNING; } } break; case 'assigned': $oEscalationDeadline = $this->Get('ttr_escalation_deadline'); if ($oEscalationDeadline != null) { // A SLA is running $iStartDate = AttributeDateTime::GetAsUnixSeconds($this->Get('start_date')); $iEscalationDeadline = AttributeDateTime::GetAsUnixSeconds($oEscalationDeadline); $ratio = ($iEscalationDeadline - time())/($iEscalationDeadline - $iStartDate); if ($ratio <= 0) { $sHilightClass = HILIGHT_CLASS_CRITICAL; } else if ($ratio <= 0.25) { $sHilightClass = HILIGHT_CLASS_WARNING; } } break; case 'escalated_tto': case 'escalated_ttr': $sHilightClass = HILIGHT_CLASS_CRITICAL; break; } return $sHilightClass; }]]> false protected Overload-DBObject Set('last_update', time()); }]]> false protected Overload-DBObject Set('last_update', time()); }]]>
10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300
10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 10 20 30 40 50 60 70 80 90 100 110
cmdbAbstractObject 1 bizmodel,searchable,incidentmgmt,requestmgmt,changemgmt,problemmgmt,lnkticket false autoincrement lnktickettodoc id ticket_id Ticket false DEL_AUTO ticket_id ref document_id Document false DEL_AUTO document_id name
10 20
10 20 10 20
cmdbAbstractObject 1 bizmodel,searchable,incidentmgmt,requestmgmt,changemgmt,problemmgmt,lnkticket false autoincrement lnktickettocontact id ticket_id Ticket false DEL_AUTO ticket_id ref contact_id Contact false DEL_AUTO contact_id name contact_id email role true
10 20 30 40
10 20 30 40 10 20 30 40
cmdbAbstractObject 1 bizmodel,searchable,incidentmgmt,requestmgmt,changemgmt,problemmgmt,lnkticket false autoincrement lnktickettoci id ticket_id Ticket false DEL_AUTO ticket_id ref ci_id FunctionalCI false DEL_AUTO ci_id name ci_id status impact true
10 20 30 40
10 20 30 10 20 30 40