Common#

NAME#

Kernel::GenericInterface::Operation::Ticket::Common - Base class for all Ticket Operations

PUBLIC INTERFACE#

Init()#

Initialize the operation by checking the web service configuration and gather of the dynamic fields.

my $Return = $CommonObject->Init(
    WebserviceID => 1,
);

Returns:

$Return = {
    Success => 1,                       # or 0 in case of failure,
    ErrorMessage => 'Error Message',
}

ValidateQueue()#

Checks if the given queue or queue ID is valid.

my $Success = $CommonObject->ValidateQueue(
    QueueID => 123,
);

my $Success = $CommonObject->ValidateQueue(
    Queue   => 'some queue',
);

Returns:

my $Success = 1;            # or 0

ValidateLock()#

Checks if the given lock or lock ID is valid.

my $Success = $CommonObject->ValidateLock(
    LockID => 123,
);

my $Success = $CommonObject->ValidateLock(
    Lock   => 'some lock',
);

Returns:

my $Success = 1;            # or 0

ValidateType()#

Checks if the given type or type ID is valid.

my $Success = $CommonObject->ValidateType(
    TypeID => 123,
);

my $Success = $CommonObject->ValidateType(
    Type   => 'some type',
);

Returns:

my $Success = 1;            # or 0

ValidateCustomer()#

Checks if the given customer user or customer ID is valid.

my $Success = $CommonObject->ValidateCustomer(
    CustomerUser   => 'some type',
);

Returns:

my $Success = 1;            # or 0

ValidateService()#

Checks if the given service or service ID is valid.

my $Success = $CommonObject->ValidateService(
    ServiceID    => 123,
    CustomerUser => 'Test',
);

my $Success = $CommonObject->ValidateService(
    Service      => 'some service',
    CustomerUser => 'Test',
);

Returns:

my $Success = 1;            # or 0

ValidateSLA()#

Checks if the given sla or sla ID is valid.

my $Success = $CommonObject->ValidateSLA(
    SLAID     => 12,
    # or
    SLA       => 'some SLA',

    ServiceID => 123,
    # or
    Service   => 'some service',
);

Returns:

my $Success = 1            # or 0

ValidateState()#

Checks if the given state or state ID is valid.

my $Success = $CommonObject->ValidateState(
    StateID => 123,
);

my $Success = $CommonObject->ValidateState(
    State   => 'some state',
);

Returns:

my $Success = 1;            # or 0

ValidatePriority()#

Checks if the given priority or priority ID is valid.

my $Success = $CommonObject->ValidatePriority(
    PriorityID => 123,
);

my $Success = $CommonObject->ValidatePriority(
    Priority   => 'some priority',
);

Returns:

my $Success = 1;            # or 0

ValidateOwner()#

Checks if the given owner or owner ID is valid.

my $Success = $CommonObject->ValidateOwner(
    OwnerID => 123,
);

my $Success = $CommonObject->ValidateOwner(
    Owner   => 'some user',
);

Returns:

my $Success = 1;            # or 0

ValidateResponsible()#

Checks if the given responsible or responsible ID is valid.

my $Success = $CommonObject->ValidateResponsible(
    ResponsibleID => 123,
);

my $Success = $CommonObject->ValidateResponsible(
    Responsible   => 'some user',
);

Returns:

my $Success = 1;            # or 0

ValidatePendingTime()#

Checks if the given pending time is valid.

my $Success = $CommonObject->ValidatePendingTime(
    PendingTime => {
        Year   => 2011,
        Month  => 12,
        Day    => 23,
        Hour   => 15,
        Minute => 0,
    },
);

my $Success = $CommonObject->ValidatePendingTime(
    PendingTime => {
        Diff => 10080,
    },
);

Returns:

my $Success = 1;            # or 0

ValidateAutoResponseType()#

Checks if the given AutoResponseType is valid.

my $Success = $CommonObject->ValidateAutoResponseType(
    AutoResponseType => 'Some AutoResponse',
);

Returns:

my $Success = 1;            # or 0

ValidateFrom()#

Checks if the given from is valid.

my $Success = $CommonObject->ValidateFrom(
    From => 'user@domain.com',
);

Returns:

my $Success = 1;            # or 0

ValidateArticleCommunicationChannel()#

Checks if provided Communication Channel is valid.

my $Success = $CommonObject->ValidateArticleCommunicationChannel(
    CommunicationChannel   => 'Internal',   # optional
                                            # or
    CommunicationChannelID => 1,            # optional
);

Returns:

my $Success = 1;            # or 0

ValidateSenderType()#

Checks if the given SenderType or SenderType ID is valid.

my $Success = $CommonObject->ValidateSenderType(
    SenderTypeID => 123,
);

my $Success = $CommonObject->ValidateenderType(
    SenderType => 'some SenderType',
);

Returns:

my $Success = 1;            # or 0

ValidateMimeType()#

Checks if the given MimeType is valid.

my $Success = $CommonObject->ValidateMimeType(
    MimeType => 'some MimeType',
);

Returns:

my $Success = 1;            # or 0

ValidateCharset()#

Checks if the given Charset is valid.

my $Success = $CommonObject->ValidateCharset(
    Charset => 'some charset',
);

Returns:

my $Success = 1;            # or 0

ValidateHistoryType()#

Checks if the given HistoryType is valid.

my $Success = $CommonObject->ValidateHistoryType(
    HistoryType => 'some HostoryType',
);

Returns:

my $Success = 1;            # or 0

ValidateTimeUnit()#

Checks if the given TimeUnit is valid.

my $Success = $CommonObject->ValidateTimeUnit(
    TimeUnit => 1,
);

Returns:

my $Success = 1;            # or 0

ValidateUserID()#

Checks if the given user ID is valid.

my $Success = $CommonObject->ValidateUserID(
    UserID => 123,
);

Returns:

my $Success = 1;            # or 0

ValidateDynamicFieldName()#

Checks if the given dynamic field name is valid.

my $Success = $CommonObject->ValidateDynamicFieldName(
    Name => 'some name',
);

Returns:

my $Success = 1;            # or 0

ValidateDynamicFieldValue()#

Checks if the given dynamic field value is valid.

my $Success = $CommonObject->ValidateDynamicFieldValue(
    Name  => 'some name',
    Value => 'some value',          # String or Integer or DateTime format
);

my $Success = $CommonObject->ValidateDynamicFieldValue(
    Value => [                      # Only for fields that can handle multiple values like
        'some value',               #   Multiselect
        'some other value',
    ],
);

returns
$Success = 1                        # or 0

ValidateDynamicFieldObjectType()#

Checks if the given dynamic field name is valid.

my $Success = $CommonObject->ValidateDynamicFieldObjectType(
    Name    => 'some name',
    Article => 1,               # if article exists
);

Returns:

my $Success = 1;            # or 0

SetDynamicFieldValue()#

Sets the value of a dynamic field.

my $Result = $CommonObject->SetDynamicFieldValue(
    Name      => 'some name',           # the name of the dynamic field
    Value     => 'some value',          # String or Integer or DateTime format
    TicketID  => 123,
    ArticleID => 123,
    UserID    => 123,
);

my $Result = $CommonObject->SetDynamicFieldValue(
    Name   => 'some name',           # the name of the dynamic field
    Value => [
        'some value',
        'some other value',
    ],
    UserID => 123,
);

Returns:

my $Result = {
    Success => 1,                        # if everything is ok
}

my $Result = {
    Success      => 0,
    ErrorMessage => 'Error description'
}

CreateAttachment()#

Creates a new attachment for the given article.

my $Result = $CommonObject->CreateAttachment(
    TicketID   => 123,
    Attachment => $Attachment,          # file content (Base64 encoded)
    ArticleID  => 456,
    UserID     => 123,
);

Returns:

my $Result = {
    Success => 1,                       # if everything is ok
}

my $Result = {
    Success      => 0,
    ErrorMessage => 'Error description'
}

CheckCreatePermissions ()#

Tests if the user have the permissions to create a ticket on a determined queue.

my $Result = $CommonObject->CheckCreatePermissions(
    Ticket   => $TicketHashReference,
    UserID   => 123,            # or 'CustomerLogin'
    UserType => 'Agent',        # or 'Customer'
);

Returns:

my $Success = 1;                    # if everything is OK

CheckAccessPermissions()#

Tests if the user have access permissions over a ticket.

my $Result = $CommonObject->CheckAccessPermissions(
    TicketID       => 123,
    UserID         => 123,                      # or 'CustomerLogin'
    UserType       => 'Agent',                  # or 'Customer'
    PermissionType => 'rw',                     # defaults to 'ro'
);

Returns:

my $Success = 1;                    # if everything is OK

_ValidateUser()#

Checks if the given user or user ID is valid.

my $Success = $CommonObject->_ValidateUser(
    UserID => 123,
);

my $Success = $CommonObject->_ValidateUser(
    User   => 'some user',
);

Returns:

my $Success = 1;            # or 0