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,
);
$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
$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
$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
$Success = 1 # or 0
ValidateCustomer()
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
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
$Success = 1 # or 0
ValidateSLA()
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
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
$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
$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
$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
$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
$Success = 1 # or 0
ValidateAutoResponseType()
checks if the given AutoResponseType is valid.
my $Success = $CommonObject->ValidateAutoResponseType(
AutoResponseType => 'Some AutoRespobse',
);
returns
$Success = 1 # or 0
ValidateEmailAddresses()
Checks if the given recipient address(es) is/are valid.
my $Success = $CommonObject->ValidateEmailAddresses(
Email => 'user@domain.com, "user2" <user2@domain.com>',
DoNotCheck => 0, # Optional, if local address check is needed (0|1, default 0)
);
returns
$Success = 1 # or undef
ValidateArticleCommunicationChannel()
checks if provided Communication Channel is valid.
my $Success = $CommonObject->ValidateArticleCommunicationChannel(
CommunicationChannel => 'Internal', # optional
# or
CommunicationChannelID => 1, # optional
);
returns
$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
$Success = 1 # or 0
ValidateHistoryType()
checks if the given HistoryType is valid.
my $Success = $CommonObject->ValidateHistoryType(
HistoryType => 'some HostoryType',
);
returns
$Success = 1 # or 0
ValidateTimeUnit()
checks if the given TimeUnit is valid.
my $Success = $CommonObject->ValidateTimeUnit(
TimeUnit => 1,
);
returns
$Success = 1 # or 0
ValidateUserID()
checks if the given user ID is valid.
my $Success = $CommonObject->ValidateUserID(
UserID => 123,
);
returns
$Success = 1 # or 0
ValidateDynamicFieldName()
checks if the given dynamic field name is valid.
my $Success = $CommonObject->ValidateDynamicFieldName(
Name => 'some name',
);
returns
$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
$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
$Result = {
Success => 1, # if everything is ok
}
$Result = {
Success => 0,
ErrorMessage => 'Error description'
}
CreateAttachment()
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'
}
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: $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'
);
returns: $Success = 1 # if everything is OK