TicketArticleCreate

TicketArticleCreate#

NAME#

Kernel::System::ProcessManagement::TransitionAction::TicketArticleCreate - A module to create an article

DESCRIPTION#

All TicketArticleCreate functions.

PUBLIC INTERFACE#

new()#

Don’t use the constructor directly, use the ObjectManager instead:

my $TicketArticleCreateObject = $Kernel::OM->Get('Kernel::System::ProcessManagement::TransitionAction::TicketArticleCreate');

Run()#

Runs TransitionAction TicketArticleCreate.

my $Success = $TicketArticleCreateActionObject->Run(
    UserID                   => 123,

    # Ticket contains the result of TicketGet including dynamic fields
    Ticket                   => \%Ticket,   # required
    ProcessEntityID          => 'P123',
    ActivityEntityID         => 'A123',
    TransitionEntityID       => 'T123',
    TransitionActionEntityID => 'TA123',

    # Config is the hash stored in a Process::TransitionAction's config key
    Config => {
        SenderType           => 'agent',                            # (required) agent|system|customer
        IsVisibleForCustomer => 1,                                  # 0 or 1
        CommunicationChannel => 'Internal',                         # Internal|Phone|Email|..., default: Internal

        %DataPayload,                                               # some parameters depending of each communication channel, please check ArticleCreate() on each
                                                                    #   communication channel for the full list of optional and mandatory parameters

        AttachmentsReuse => 1                                       # optional, 1|0 - Reuse of attachments stored in the dynamic field configured in Process::DynamicFieldProcessManagementAttachment.
        TimeUnit => 123,                                            # optional, to set the accounting time
        UserID   => 123,                                            # optional, to override the UserID from the logged user
   },
);

Returns:

$Success = 1; # 0

# Internal article example:

my $Success = $TicketArticleCreateActionObject->Run(
    UserID => 123,
    Ticket => {
        TicketNumber => '20101027000001',
        Title        => 'some title',
        TicketID     => 123,
        State        => 'some state',
        # ... (all ticket properties)
    },
    ProcessEntityID          => 'P123',
    ActivityEntityID         => 'A123',
    TransitionEntityID       => 'T123',
    TransitionActionEntityID => 'TA123',
    Config                   => {
        SenderType           => 'agent',
        IsVisibleForCustomer => 1,
        CommunicationChannel => 'Internal',

        # Internal article data payload.
        From           => 'Some Agent <email@example.com>',
        To             => 'Some Customer A <customer-a@example.com>',
        Subject        => 'some short description',
        Body           => 'the message text',
        Charset        => 'ISO-8859-15',
        MimeType       => 'text/plain',
        HistoryType    => 'OwnerUpdate',
        HistoryComment => 'Some free text!',
        UnlockOnAway   => 1,
    },
);

# Email article example:

my $Success = $TicketArticleCreateActionObject->Run(
    UserID => 123,
    Ticket => {
        TicketNumber => '20101027000001',
        Title        => 'some title',
        TicketID     => 123,
        State        => 'some state',
        # ... (all ticket properties, as the result from Kernel::System::Ticket::TicketGet)
    },
    ProcessEntityID          => 'P123',
    ActivityEntityID         => 'A123',
    TransitionEntityID       => 'T123',
    TransitionActionEntityID => 'TA123',
    Config                   => {
        SenderType           => 'agent',
        IsVisibleForCustomer => 1,
        CommunicationChannel => 'Email',

        # Email article data payload.
        From               => 'Some Agent <email@example.com>',
        To                 => 'Some Customer A <customer-a@example.com>',
        Subject            => 'some short description',
        Body               => 'the message text',
        Charset            => 'ISO-8859-15',
        MimeType           => 'text/plain',
        HistoryType        => 'EmailAgent',
        HistoryComment     => 'Some free text!',
        UnlockOnAway       => 1,
        DynamicField_NameX => 'Value of DF Article',
    },
);