OTRS 8.0 API Reference Perl

Description manuals and libraries
OTRS 8.0 API Reference Perl > Perl Modules > Kernel::System::ProcessManagement::Modules::TicketCreate

NAME

Kernel::System::ProcessManagement::Modules::TicketCreate - A module to create a ticket

DESCRIPTION

All TicketCreate functions.

PUBLIC INTERFACE

new()

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

    my $TicketCreateObject = $Kernel::OM->Get('Kernel::System::ProcessManagement::Modules::TicketCreate');

Run()

    Run Data

    my $TicketCreateResult = $TicketCreateActionObject->Run(
        UserID                   => 123,
        Ticket                   => \%Ticket,   # required
        ProcessEntityID          => 'P123',
        ActivityEntityID         => 'A123',
        SequenceFlowEntityID       => 'T123',
        SequenceFlowActionEntityID => 'TA123',
        Config                   => {
            # ticket required:
            Title         => 'Some Ticket Title',
            Queue         => 'Raw',              # or QueueID => 123,
            Lock          => 'unlock',
            Priority      => '3 normal',         # or PriorityID => 2,
            State         => 'new',              # or StateID => 5,
            CustomerID    => '123465',
            CustomerUser  => 'customer@example.com',
            Owner         => 'someuserlogin',    # or OwnerID => 123

            # ticket optional:
            TN              => $TicketObject->TicketCreateNumber(), # optional
            Type            => 'Incident',            # or TypeID => 1, not required
            Service         => 'Service A',           # or ServiceID => 1, not required
            SLA             => 'SLA A',               # or SLAID => 1, not required
            ResponsibleID   => 123,                   # not required
            ArchiveFlag     => 'y',                   # (y|n) not required
            PendingTime     => '2011-12-23 23:05:00', # optional (for pending states)
            PendingTimeDiff => 123 ,                  # optional (for pending states)

            # article required: (if one of them is not present, article will not be created without any error message)
            SenderType           => 'agent',                            # agent|system|customer
            IsVisibleForCustomer => 1,                                  # required
            CommunicationChannel => 'Internal',                         # Internal|Phone|Email|..., default: Internal

            %DataPayload,                                               # some parameters depending of each communication channel

            # article optional:
            TimeUnit => 123

            # other:
            DynamicField_NameX => $Value,
            LinkAs => $LinkType,                                        # Normal, Parent, Child, etc. (respective original ticket)
            UserID => 123,                                              # optional, to override the UserID from the logged user

            # specific for <OTRS_AGENT_BODY_RICHTEXT> / <OTRS_CUSTOMER_BODY_RICHTEXT> OTRS smart tags:
            AgentBodyRichTextQuote    => 0,                             # optional, 0 or 1, insert the last agent article as quote like 'AgentTicketCompose' frontend
            CustomerBodyRichTextQuote => 0,                             # optional, 0 or 1, insert the last customer article as quote like 'AgentTicketCompose' frontend

            AgentBodyRichTextInlineImagesInclude    => 0,               # optional, 0 or 1, inline attachments of the last agent article are taken over to the new article
            CustomerBodyRichTextInlineImagesInclude => 0,               # optional, 0 or 1, inline attachments of the last customer article are taken over to the new article

            AgentBodyRichTextAttachmentsInclude    => 0,                # optional, 0 or 1, all attachments of the last agent article are taken over to the new article
            CustomerBodyRichTextAttachmentsInclude => 0,                # optional, 0 or 1, all attachments of the last customer article are taken over to the new article
        }
    );
    Ticket contains the result of TicketGet including DynamicFields
    Config is the Config Hash stored in a Process::SequenceFlowAction's  Config key
    Returns:

    $TicketCreateResult = 1; # 0

    );