Kernel::WebApp::Util::Role::ProvidesAgentTicketLock

NAME

Kernel::WebApp::Util::Role::ProvidesAgentTicketLock – Role that provides helpers to check and lock the ticket.

IsTicketLocked()

Check if the ticket is locked.

    my $IsLocked = $Controller->IsTicketLocked(
        TicketID => '...' # (optional) if not given uses the controller param 'TicketID'
    );

TicketLock()

Tries to lock the ticket to the current user.

    my $Result = $Controller->TicketLock(
        TicketID       => '...' # (optional) if not given uses the controller param 'TicketID'
        SkipOwnerCheck => '...' # (optional) 1|0 in case the ticket is already locked, do not perform
                                #   the owner check and return success
    );

Returns

    # case the lock fails
    {
        Success => 0,
        Error   => 'LockFailed',
    }

    # case the ticket is already locked and can't be locked to
    #   current user
    {
        Success => 0,
        Error   => 'AccessDenied',
    }

    # ticket licked
    {
        Success => 1,
        Data    => {
            PreviousOwnerID => '...' # In case the owner was changed
        },
    }

ProvidesAgentTicketLockTicketID()

Returns the ticket id to use, if it was not given as a method parameter, it will get from the controller context ($Controller->param('TicketID')).

Scroll to Top