Kernel::GenericInterface::Operation::Ticket::Common - Base class for all Ticket Operations
initialize the operation by checking the web service configuration and gather of the dynamic fields
my $Return = $CommonObject->Init( WebserviceID => 1, ); $Return = { Success => 1, # or 0 in case of failure, ErrorMessage => 'Error Message', }
checks if the given queue or queue ID is valid.
my $Success = $CommonObject->ValidateQueue( QueueID => 123, ); my $Success = $CommonObject->ValidateQueue( Queue => 'some queue', ); returns $Success = 1 # or 0
checks if the given lock or lock ID is valid.
my $Success = $CommonObject->ValidateLock( LockID => 123, ); my $Success = $CommonObject->ValidateLock( Lock => 'some lock', ); returns $Success = 1 # or 0
checks if the given type or type ID is valid.
my $Success = $CommonObject->ValidateType( TypeID => 123, ); my $Success = $CommonObject->ValidateType( Type => 'some type', ); returns $Success = 1 # or 0
checks if the given customer user or customer ID is valid.
my $Success = $CommonObject->ValidateCustomer( CustomerID => 123, ); my $Success = $CommonObject->ValidateCustomer( CustomerUser => 'some type', ); returns $Success = 1 # or 0
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 $Success = 1 # or 0
checks if the given service or service ID is valid.
my $Success = $CommonObject->ValidateSLA( SLAID => 12, ServiceID => 123, # || Service => 'some service' ); my $Success = $CommonObject->ValidateService( SLA => 'some SLA', ServiceID => 123, # || Service => 'some service' ); returns $Success = 1 # or 0
checks if the given state or state ID is valid.
my $Success = $CommonObject->ValidateState( StateID => 123, ); my $Success = $CommonObject->ValidateState( State => 'some state', ); returns $Success = 1 # or 0
checks if the given priority or priority ID is valid.
my $Success = $CommonObject->ValidatePriority( PriorityID => 123, ); my $Success = $CommonObject->ValidatePriority( Priority => 'some priority', ); returns $Success = 1 # or 0
checks if the given owner or owner ID is valid.
my $Success = $CommonObject->ValidateOwner( OwnerID => 123, ); my $Success = $CommonObject->ValidateOwner( Owner => 'some user', ); returns $Success = 1 # or 0
checks if the given responsible or responsible ID is valid.
my $Success = $CommonObject->ValidateResponsible( ResponsibleID => 123, ); my $Success = $CommonObject->ValidateResponsible( Responsible => 'some user', ); returns $Success = 1 # or 0
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 $Success = 1 # or 0
checks if the given AutoResponseType is valid.
my $Success = $CommonObject->ValidateAutoResponseType( AutoResponseType => 'Some AutoRespobse', ); returns $Success = 1 # or 0
checks if the given from is valid.
my $Success = $CommonObject->ValidateFrom( From => 'user@domain.com', ); returns $Success = 1 # or 0
checks if provided Communication Channel is valid.
my $Success = $CommonObject->ValidateArticleCommunicationChannel( CommunicationChannel => 'Internal', # optional # or CommunicationChannelID => 1, # optional ); returns $Success = 1 # or 0
checks if the given SenderType or SenderType ID is valid.
my $Success = $CommonObject->ValidateSenderType( SenderTypeID => 123, ); my $Success = $CommonObject->ValidateenderType( SenderType => 'some SenderType', ); returns $Success = 1 # or 0
checks if the given MimeType is valid.
my $Success = $CommonObject->ValidateMimeType( MimeTypeID => 'some MimeType', ); returns $Success = 1 # or 0
checks if the given Charset is valid.
my $Success = $CommonObject->ValidateCharset( Charset => 'some charset', ); returns $Success = 1 # or 0
checks if the given HistoryType is valid.
my $Success = $CommonObject->ValidateHistoryType( HistoryType => 'some HostoryType', ); returns $Success = 1 # or 0
checks if the given TimeUnit is valid.
my $Success = $CommonObject->ValidateTimeUnit( TimeUnit => 1, ); returns $Success = 1 # or 0
checks if the given user ID is valid.
my $Success = $CommonObject->ValidateUserID( UserID => 123, ); returns $Success = 1 # or 0
checks if the given dynamic field name is valid.
my $Success = $CommonObject->ValidateDynamicFieldName( Name => 'some name', ); returns $Success = 1 # or 0
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
checks if the given dynamic field name is valid.
my $Success = $CommonObject->ValidateDynamicFieldObjectType( Name => 'some name', Article => 1, # if article exists ); returns $Success = 1 # or 0
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 $Result = { Success => 1, # if everything is ok } $Result = { Success => 0, ErrorMessage => 'Error description' }
creates a new attachment for the given article.
my $Result = $CommonObject->CreateAttachment( TicketID => 123, Attachment => $Data, # file content (Base64 encoded) ArticleID => 456, UserID => 123, ); returns $Result = { Success => 1, # if everything is ok } $Result = { Success => 0, ErrorMessage => 'Error description' }
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: $Success = 1 # if everything is OK
Tests if the user have access permissions over a ticket
my $Result = $CommonObject->CheckAccessPermissions( TicketID => 123, UserID => 123, # or 'CustomerLogin' UserType => 'Agent', # or 'Customer' );
returns: $Success = 1 # if everything is OK
This software is part of the OTRS project (https://otrs.org/).
This software comes with ABSOLUTELY NO WARRANTY. For details, see the enclosed file COPYING for license information (GPL). If you did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.