Kernel::System::OTRSTicketWatchlist

NAME

Kernel::System::OTRSTicketWatchlist – OTRSTicketWatchlist lib

DESCRIPTION

Manage all ticket watching related events

PUBLIC INTERFACE

new()

create an object. Do not use it directly, instead use:

    use Kernel::System::ObjectManager;
    local $Kernel::OM = Kernel::System::ObjectManager->new();
    my $TicketWatchingObject = $Kernel::OM->Get('Kernel::System::Valid');

ReminderGet()

get all attributes of a reminder

    my %Reminder = $TicketWatchingObject->ReminderGet(
        ReminderID => 123,
    );

    or

    my %Reminder = $TicketWatchingObject->ReminderGet(
        UserID   => 123,
        TicketID => 234,
    );

ReminderSet()

set a reminder

    $TicketWatchingObject->ReminderSet(
        UserID       => 1,
        TicketID     => 4,
        ReminderTime => '2006-01-01 12:00:00',
        Note         => 'abc\tdef', # optional
        For          => 0, # watchlist_id or '0' for tw-reminder
    );

ReminderDelete()

delete a reminder

    $TicketWatchingObject->ReminderDelete(
        UserID   => 1,
        TicketID => 4,
    );

or

    $TicketWatchingObject->ReminderDelete(
        ReminderID => 5,
    );

ReminderSearch()

search reminder ids

    my @ReminderIDs = $TicketWatchingObject->ReminderSearch(
        UserID      => 123,                   # optional
        TicketID    => 234,                   # optional
        Until       => '2006-12-12 10:10:00', # optional
        From        => '2006-12-12 10:10:00', # optional
        WatchlistID => 1,                     # optional
    );

ReminderSend()

send reminder

    $TicketWatchingObject->ReminderSend(
        ReminderID => 123,
    );

WatchlistAdd()

add a watch list

    $TicketWatchingObject->WatchlistAdd(
        Name                  => 'new ticket list',
        AgentArticleNotify    => 0,      # 1|0 (notify on new agent articles)
        CustomerArticleNotify => 0,      # 1|0 (notify on new customer articles)
        OwnerChangeNotify     => 0,      # 1|0 (notify on owner changes)
        QueueChangeNotify     => 0,      # 1|0 (notify on queue changes)
        StateChangeNotify     => 0,      # 1|0 (notify on changes to defined ticket states)
        StateChangeTo         => [1, 2], # (watched state ids for StateChangeNotify)
        UserID                => 123,
    );

WatchlistGet()

get all attributes of a watch list

    my %Watchlist = $TicketWatchingObject->WatchlistGet(
        WatchlistID => 1,
    );

WatchlistChange()

update watch list configuration

    $TicketWatchingObject->WatchlistChange(
        WatchlistID           => 1,
        Name                  => 'new name',
        Color                 => 'new color',
        AgentArticleNotify    => 0,      # 0|1
        CustomerArticleNotify => 0,      # 0|1
        OwnerChangeNotify     => 0,      # 0|1
        QueueChangeNotify     => 0,      # 0|1
        StateChangeNotify     => 0,      # 0|1
        StateChangeTo         => (1, 2), # ticket state ids
        UserID                => 1,
    );

WatchlistDelete()

delete watch list

    $TicketWatchingObject->WatchlistDelete(
        WatchlistID => 1,
        UserID      => 1,
    );

WatchlistMove()

assign watch list to a different owner

    $TicketWatchingObject->WatchlistMove(
        WatchlistID => 1,
        NewOwnerID  => 2, # user id of new owner
        UserID      => 1, # user id of current owner
    );

GetAllWatchlists()

get all watch lists optionally only those available to a specific user when an user is specified, results can be limited to watch lists owned by the specified user

    my %Watchlists = $TicketWatchingObject->GetAllWatchlists(
        UserID => 123, # optional
        Owner  => 1,   # optional, only in combination with UserID
    );

TicketWatchlistAdd()

assign ticket to a watch list

    my $Success = $TicketWatchingObject->TicketWatchlistAdd(
        TicketID    => 1,
        WatchlistID => 1,
        UserID      => 1,
    );

TicketWatchlistDel()

remove ticket from a watch list.

    my $Success = $TicketWatchingObject->TicketWatchlistDel(
        TicketID    => 1,
        WatchlistID => 1,
        UserID      => 1,
    );

TicketWatchlistGetAllTickets()

get all tickets of a watch list.

    my %Tickets = $TicketWatchingObject->TicketWatchlistGetAllTickets(
        WatchlistID => 1,
    );

TicketGetAllWatchlists()

get all watch lists a ticket is assigned to. optionally restrict to watch lists accessible by user.

    my %Watchlists = $TicketWatchingObject->TicketGetAllWatchlists(
        TicketID => 1,
        UserID   => 1, # optional
    );

TicketWatchlistCheck()

is ticket assigned to any watch list. optionally restrict to specific watch list

    my $Assigned = $TicketWatchingObject->TicketWatchlistCheck(
        TicketID => 1,
        WatchlistID => 1, # optional
    );

WatchlistDeputyAdd()

add deputy to watch list

    $TicketWatchingObject->WatchlistDeputyAdd(
        WatchlistID  => 1,
        UserID       => 1,
        DeputyUserID => 2,
    );

WatchlistDeputyRemove()

remove deputy from watch list

    $TicketWatchingObject->WatchlistDeputyRemove(
        WatchlistID  => 1,
        UserID       => 1,
        DeputyUserID => 2,
    );

WatchlistDeputyGet()

JUST FOR COMPACT

get watch list deputies. optionally restrict to given deputy id

    my @DeputyIDs = $TicketWatchingObject->WatchlistDeputyGet(
        WatchlistID => 1,
        DeputyID    => 1, # optional
    );

WatchlistDeputyList()

get watch list deputy list.

    my %List = $TicketWatchingObject->WatchlistDeputyList();

WatchlistDeputyDataGet()

get deputies with data optionally restrict to given deputy id

    my @DeputyArrayRef = $TicketWatchingObject->WatchlistDeputyDataGet(
        WatchlistID => 1,
        DeputyID    => 1, # optional
    );

WatchlistDeputyUpdate()

update deputy watch list config

    $TicketWatchingObject->WatchlistDeputyUpdate(
        WatchlistID           => 1,
        DeputyID              => 1,
        AgentArticleNotify    => 0, # 0|1
        CustomerArticleNotify => 0, # 0|1
        OwnerChangeNotify     => 0, # 0|1
        QueueChangeNotify     => 0, # 0|1
        StateChangeNotify     => 0, # 0|1
    );
Scroll to Top