ITSMChangeManagement -> rel-3_2 API documentation

NAME

use Kernel::System::ITSMChange::ITSMWorkOrder::Event::WorkOrderActualTimesSet - WorkOrderActualTimesSet event module for ITSMWorkOrder

SYNOPSIS

Event handler module for setting the actual start and end time in WorkOrders.

PUBLIC INTERFACE

  • new()

    create an object

    use Kernel::Config;
    use Kernel::System::Encode;
    use Kernel::System::Log;
    use Kernel::System::DB;
    use Kernel::System::Main;
    use Kernel::System::Time;
    use Kernel::System::ITSMChange::ITSMWorkOrder;
    use Kernel::System::ITSMChange::ITSMWorkOrder::Event::WorkOrderActualTimesSet;
    
    my $ConfigObject = Kernel::Config->new();
    my $EncodeObject = Kernel::System::Encode->new(
        ConfigObject => $ConfigObject,
    );
    my $LogObject = Kernel::System::Log->new(
        ConfigObject => $ConfigObject,
        EncodeObject => $EncodeObject,
    );
    my $MainObject = Kernel::System::Main->new(
        ConfigObject => $ConfigObject,
        EncodeObject => $EncodeObject,
        LogObject    => $LogObject,
    );
    my $TimeObject = Kernel::System::Time->new(
        ConfigObject => $ConfigObject,
        LogObject    => $LogObject,
    );
    my $DBObject = Kernel::System::DB->new(
        ConfigObject => $ConfigObject,
        EncodeObject => $EncodeObject,
        LogObject    => $LogObject,
        MainObject   => $MainObject,
    );
    my $WorkOrderObject = Kernel::System::ITSMChange::ITSMWorkOrder->new(
        ConfigObject => $ConfigObject,
        EncodeObject => $EncodeObject,
        LogObject    => $LogObject,
        DBObject     => $DBObject,
        TimeObject   => $TimeObject,
        MainObject   => $MainObject,
    );
    my $WorkOrderActualTimesSetObject = Kernel::System::ITSMChange::ITSMWorkOrder::Event::WorkOrderActualTimesSet->new(
        ConfigObject    => $ConfigObject,
        EncodeObject    => $EncodeObject,
        LogObject       => $LogObject,
        DBObject        => $DBObject,
        TimeObject      => $TimeObject,
        MainObject      => $MainObject,
        WorkOrderObject => $WorkOrderObject,
    );
    
  • Run()

    The Run() method sets the actual start and end time of a workorder if it is not yet set. The actual start time is set if a configurable workorder state is reached, the actual end time is set if the workorder reaches any end state.

    This is triggered by the WorkOrderUpdate event.

    The methods returns 1 on success, undef otherwise.

    my $Success = $EventObject->Run(
        Event => 'WorkOrderUpdatePost',
        Data => {
            WorkOrderID => 123,
        },
        Config => {
            Event       => 'WorkOrderUpdatePost',
            Module      => 'Kernel::System::ITSMChange::ITSMWorkOrder::Event::WorkOrderActualTimesSet',
            Transaction => '0',
        },
        UserID => 1,
    );
    

TERMS AND CONDITIONS

This software is part of the OTRS project (http://otrs.org/).

This software comes with ABSOLUTELY NO WARRANTY. For details, see the enclosed file COPYING for license information (AGPL). If you did not receive this file, see http://www.gnu.org/licenses/agpl.txt.

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

  • Around line 110:

    =cut found outside a pod block. Skipping to next block.