Kernel::System::Ticket - ticket lib
All ticket functions.
new()
use Kernel::Config;
use Kernel::System::Encode;
use Kernel::System::Log;
use Kernel::System::Time;
use Kernel::System::Main;
use Kernel::System::DB;
use Kernel::System::Ticket; |
my $ConfigObject = Kernel::Config->new();
my $EncodeObject = Kernel::System::Encode->new(
ConfigObject => $ConfigObject,
);
my $LogObject = Kernel::System::Log->new(
ConfigObject => $ConfigObject,
EncodeObject => $EncodeObject,
);
my $TimeObject = Kernel::System::Time->new(
ConfigObject => $ConfigObject,
LogObject => $LogObject,
);
my $MainObject = Kernel::System::Main->new(
ConfigObject => $ConfigObject,
EncodeObject => $EncodeObject,
LogObject => $LogObject,
);
my $DBObject = Kernel::System::DB->new(
ConfigObject => $ConfigObject,
EncodeObject => $EncodeObject,
LogObject => $LogObject,
MainObject => $MainObject,
);
my $TicketObject = Kernel::System::Ticket->new(
ConfigObject => $ConfigObject,
LogObject => $LogObject,
DBObject => $DBObject,
MainObject => $MainObject,
TimeObject => $TimeObject,
EncodeObject => $EncodeObject,
GroupObject => $GroupObject, # if given
CustomerUserObject => $CustomerUserObject, # if given
QueueObject => $QueueObject, # if given
); |
TicketCreateNumber()
my $TicketNumber = $TicketObject->TicketCreateNumber(); |
TicketCheckNumber()
my $TicketID = $TicketObject->TicketCheckNumber(
Tn => '200404051004575',
); |
TicketCreate()
my $TicketID = $TicketObject->TicketCreate(
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',
OwnerID => 123,
UserID => 123,
); |
or |
my $TicketID = $TicketObject->TicketCreate(
TN => $TicketObject->TicketCreateNumber(), # optional
Title => 'Some Ticket Title',
Queue => 'Raw', # or QueueID => 123,
Lock => 'unlock',
Priority => '3 normal', # or PriorityID => 2,
State => 'new', # or StateID => 5,
Type => 'normal', # or TypeID => 1, not required
Service => 'Service A', # or ServiceID => 1, not required
SLA => 'SLA A', # or SLAID => 1, not required
CustomerID => '123465',
CustomerUser => 'customer@example.com',
OwnerID => 123,
ResponsibleID => 123, # not required
ArchiveFlag => 'y', # (y|n) not required
UserID => 123,
); |
Events: TicketCreate
TicketDelete()
my $Success = $TicketObject->TicketDelete(
TicketID => 123,
UserID => 123,
); |
Events: TicketDelete
TicketIDLookup()
my $TicketID = $TicketObject->TicketIDLookup(
TicketNumber => '2004040510440485',
UserID => 123,
); |
TicketNumberLookup()
my $TicketNumber = $TicketObject->TicketNumberLookup(
TicketID => 123,
UserID => 123,
); |
TicketSubjectBuild()
This will generate a subject like "RE: [Ticket# 2004040510440485] Some subject" |
my $NewSubject = $TicketObject->TicketSubjectBuild(
TicketNumber => '2004040510440485',
Subject => $OldSubject,
Action => 'Reply',
); |
This will generate a subject like "[Ticket# 2004040510440485] Some subject"
(so without RE: ) |
my $NewSubject = $TicketObject->TicketSubjectBuild(
TicketNumber => '2004040510440485',
Subject => $OldSubject,
Type => 'New',
Action => 'Reply',
); |
This will generate a subject like "FWD: [Ticket# 2004040510440485] Some subject" |
my $NewSubject = $TicketObject->TicketSubjectBuild(
TicketNumber => '2004040510440485',
Subject => $OldSubject,
Action => 'Forward', # Possible values are Reply and Forward, Reply is default.
); |
This will generate a subject like "[Ticket# 2004040510440485] Re: Some subject"
(so without clean-up of subject) |
my $NewSubject = $TicketObject->TicketSubjectBuild(
TicketNumber => '2004040510440485',
Subject => $OldSubject,
Type => 'New',
NoCleanup => 1,
); |
TicketSubjectClean()
my $NewSubject = $TicketObject->TicketSubjectClean(
TicketNumber => '2004040510440485',
Subject => $OldSubject,
); |
TicketGet()
my %Ticket = $TicketObject->TicketGet(
TicketID => 123,
UserID => 123,
); |
Returns:
%Ticket = (
TicketNumber => '20101027000001',
TicketID => 123,
State => 'some state',
StateID => 123,
StateType => 'some state type',
Priority => 'some priority',
PriorityID => 123,
Lock => 'lock',
LockID => 123,
Queue => 'some queue',
QueueID => 123,
CustomerID => 'customer_id_123',
CustomerUserID => 'customer_user_id_123',
Owner => 'some_owner_login',
OwnerID => 123,
Type => 'some ticket type',
TypeID => 123,
SLA => 'some sla',
SLAID => 123,
Service => 'some service',
ServiceID => 123,
Responsible => 'some_responsible_login',
ResponsibleID => 123,
Age => 3456,
Created => '2010-10-27 20:15:00'
CreateTimeUnix => '1231414141',
Changed => '2010-10-27 20:15:15',
ArchiveFlag => 'y',
TicketFreeKey1-16
TicketFreeText1-16
TicketFreeTime1-6 |
# (time stampes of expected escalations)
EscalationResponseTime (unix time stamp of response time escalation)
EscalationUpdateTime (unix time stamp of update time escalation)
EscalationSolutionTime (unix time stamp of solution time escalation) |
# (general escalation info of nearest escalation type)
EscalationDestinationIn (escalation in e. g. 1h 4m)
EscalationDestinationTime (date of escalation in unix time, e. g. 72193292)
EscalationDestinationDate (date of escalation, e. g. "2009-02-14 18:00:00")
EscalationTimeWorkingTime (seconds of working/service time till escalation, e. g. "1800")
EscalationTime (seconds total till escalation of nearest escalation time type - response, update or solution time, e. g. "3600") |
# (detail escalation info about first response, update and solution time)
FirstResponseTimeEscalation (if true, ticket is escalated)
FirstResponseTimeNotification (if true, notify - x% of escalation has reached)
FirstResponseTimeDestinationTime (date of escalation in unix time, e. g. 72193292)
FirstResponseTimeDestinationDate (date of escalation, e. g. "2009-02-14 18:00:00")
FirstResponseTimeWorkingTime (seconds of working/service time till escalation, e. g. "1800")
FirstResponseTime (seconds total till escalation, e. g. "3600") |
UpdateTimeEscalation (if true, ticket is escalated)
UpdateTimeNotification (if true, notify - x% of escalation has reached)
UpdateTimeDestinationTime (date of escalation in unix time, e. g. 72193292)
UpdateTimeDestinationDate (date of escalation, e. g. "2009-02-14 18:00:00")
UpdateTimeWorkingTime (seconds of working/service time till escalation, e. g. "1800")
UpdateTime (seconds total till escalation, e. g. "3600") |
SolutionTimeEscalation (if true, ticket is escalated)
SolutionTimeNotification (if true, notify - x% of escalation has reached)
SolutionTimeDestinationTime (date of escalation in unix time, e. g. 72193292)
SolutionTimeDestinationDate (date of escalation, e. g. "2009-02-14 18:00:00")
SolutionTimeWorkingTime (seconds of working/service time till escalation, e. g. "1800")
SolutionTime (seconds total till escalation, e. g. "3600")
); |
To get extended ticket attributes, use param Extended:
my %Ticket = $TicketObject->TicketGet(
TicketID => 123,
UserID => 123,
Extended => 1,
); |
Additional params are:
%Ticket = (
FirstResponse (timestamp of first response, first contact with customer)
FirstResponseInMin (minutes till first response)
FirstResponseDiffInMin (minutes till or over first response) |
SolutionTime (timestamp of solution time, also close time)
SolutionInMin (minutes till solution time)
SolutionDiffInMin (minutes till or over solution time) |
FirstLock (timestamp of first lock)
); |
TicketTitleUpdate()
my $Success = $TicketObject->TicketTitleUpdate(
Title => 'Some Title',
TicketID => 123,
UserID => 1,
); |
Events: TicketTitleUpdate
TicketUnlockTimeoutUpdate()
my $Success = $TicketObject->TicketUnlockTimeoutUpdate(
UnlockTimeout => $TimeObject->SystemTime(),
TicketID => 123,
UserID => 143,
); |
Events: TicketUnlockTimeoutUpdate
TicketQueueID()
my $QueueID = $TicketObject->TicketQueueID(
TicketID => 123,
); |
TicketMoveList()
my %Queues = $TicketObject->TicketMoveList(
Type => 'create',
UserID => 123,
); |
my %Queues = $TicketObject->TicketMoveList(
QueueID => 123,
UserID => 123,
); |
my %Queues = $TicketObject->TicketMoveList(
TicketID => 123,
UserID => 123,
); |
TicketQueueSet()
my $Success = $TicketObject->TicketQueueSet(
QueueID => 123,
TicketID => 123,
UserID => 123,
); |
my $Success = $TicketObject->TicketQueueSet(
Queue => 'Some Queue Name',
TicketID => 123,
UserID => 123,
); |
my $Success = $TicketObject->TicketQueueSet(
Queue => 'Some Queue Name',
TicketID => 123,
Comment => 'some comment', # optional
ForceNotificationToUserID => [1,43,56], # if you want to force somebody
UserID => 123,
); |
Optional attribute:
SendNoNotification disables or enables agent and customer notification for this
action. |
For example: |
SendNoNotification => 0, # optional 1|0 (send no agent and customer notification) |
Events: TicketQueueUpdate
TicketMoveQueueList()
my @QueueIDList = $TicketObject->TicketMoveQueueList(
TicketID => 123,
Type => 'ID',
); |
Returns:
@QueueIDList = ( 1, 2, 3 ); |
my @QueueList = $TicketObject->TicketMoveQueueList(
TicketID => 123,
Type => 'Name',
); |
Returns:
@QueueList = ( 'QueueA', 'QueueB', 'QueueC' ); |
TicketTypeList()
my %Types = $TicketObject->TicketTypeList(
UserID => 123,
); |
my %Types = $TicketObject->TicketTypeList(
QueueID => 123,
UserID => 123,
); |
my %Types = $TicketObject->TicketTypeList(
TicketID => 123,
UserID => 123,
); |
Returns:
%Types = (
1 => 'default',
2 => 'request',
3 => 'offer',
); |
TicketTypeSet()
my $Success = $TicketObject->TicketTypeSet(
TypeID => 123,
TicketID => 123,
UserID => 123,
); |
my $Success = $TicketObject->TicketTypeSet(
Type => 'normal',
TicketID => 123,
UserID => 123,
); |
Events: TicketTypeUpdate
TicketServiceList()
my %Services = $TicketObject->TicketServiceList(
QueueID => 123,
UserID => 123,
); |
my %Services = $TicketObject->TicketServiceList(
CustomerUserID => 123,
QueueID => 123,
); |
my %Services = $TicketObject->TicketServiceList(
CustomerUserID => 123,
TicketID => 123,
UserID => 123,
); |
Returns:
%Services = (
1 => 'ServiceA',
2 => 'ServiceB',
3 => 'ServiceC',
); |
TicketServiceSet()
my $Success = $TicketObject->TicketServiceSet(
ServiceID => 123,
TicketID => 123,
UserID => 123,
); |
my $Success = $TicketObject->TicketServiceSet(
Service => 'Service A',
TicketID => 123,
UserID => 123,
); |
Events: TicketServiceUpdate
TicketEscalationPreferences()
my %Escalation = $TicketObject->TicketEscalationPreferences(
Ticket => $Param{Ticket},
UserID => $Param{UserID},
); |
TicketEscalationDateCalculation()
my %Escalation = $TicketObject->TicketEscalationDateCalculation(
Ticket => $Param{Ticket},
UserID => $Param{UserID},
); |
it returnes
(general escalation info)
EscalationDestinationIn (escalation in e. g. 1h 4m)
EscalationDestinationTime (date of escalation in unix time, e. g. 72193292)
EscalationDestinationDate (date of escalation, e. g. "2009-02-14 18:00:00")
EscalationTimeWorkingTime (seconds of working/service time till escalation, e. g. "1800")
EscalationTime (seconds total till escalation, e. g. "3600") |
(detail escalation info about first response, update and solution time)
FirstResponseTimeEscalation (if true, ticket is escalated)
FirstResponseTimeNotification (if true, notify - x% of escalation has reached)
FirstResponseTimeDestinationTime (date of escalation in unix time, e. g. 72193292)
FirstResponseTimeDestinationDate (date of escalation, e. g. "2009-02-14 18:00:00")
FirstResponseTimeWorkingTime (seconds of working/service time till escalation, e. g. "1800")
FirstResponseTime (seconds total till escalation, e. g. "3600") |
UpdateTimeEscalation (if true, ticket is escalated)
UpdateTimeNotification (if true, notify - x% of escalation has reached)
UpdateTimeDestinationTime (date of escalation in unix time, e. g. 72193292)
UpdateTimeDestinationDate (date of escalation, e. g. "2009-02-14 18:00:00")
UpdateTimeWorkingTime (seconds of working/service time till escalation, e. g. "1800")
UpdateTime (seconds total till escalation, e. g. "3600") |
SolutionTimeEscalation (if true, ticket is escalated)
SolutionTimeNotification (if true, notify - x% of escalation has reached)
SolutionTimeDestinationTime (date of escalation in unix time, e. g. 72193292)
SolutionTimeDestinationDate (date of escalation, e. g. "2009-02-14 18:00:00")
SolutionTimeWorkingTime (seconds of working/service time till escalation, e. g. "1800")
SolutionTime (seconds total till escalation, e. g. "3600") |
TicketEscalationIndexBuild()
my $Success = $TicketObject->TicketEscalationIndexBuild(
Ticket => $Param{Ticket},
UserID => $Param{UserID},
); |
TicketSLAList()
my %SLAs = $TicketObject->TicketSLAList(
ServiceID => 1,
UserID => 123,
); |
my %SLAs = $TicketObject->TicketSLAList(
QueueID => 123,
ServiceID => 1,
UserID => 123,
); |
my %SLAs = $TicketObject->TicketSLAList(
TicketID => 123,
ServiceID => 1,
UserID => 123,
); |
Returns:
%SLAs = (
1 => 'SLA A',
2 => 'SLA B',
3 => 'SLA C',
); |
TicketSLASet()
my $Success = $TicketObject->TicketSLASet(
SLAID => 123,
TicketID => 123,
UserID => 123,
); |
my $Success = $TicketObject->TicketSLASet(
SLA => 'SLA A',
TicketID => 123,
UserID => 123,
); |
Events: TicketSLAUpdate
TicketCustomerSet()
my $Success = $TicketObject->TicketCustomerSet(
No => 'client123',
User => 'client-user-123',
TicketID => 123,
UserID => 23,
); |
Events: TicketCustomerUpdate
TicketFreeTextGet()Note: the current value is accessible over TicketGet()
my $HashRef = $TicketObject->TicketFreeTextGet(
Type => 'TicketFreeText3',
TicketID => 123,
UserID => 123, # or CustomerUserID
); |
my $HashRef = $TicketObject->TicketFreeTextGet(
Type => 'TicketFreeText3',
UserID => 123, # or CustomerUserID
); |
# fill up with existing values
my $HashRef = $TicketObject->TicketFreeTextGet(
Type => 'TicketFreeText3',
FillUp => 1,
UserID => 123, # or CustomerUserID
); |
Returns:
$HashRef = {
'Storage Value A' => 'Display Value A',
'Storage Value B' => 'Display Value B',
'Storage Value C' => 'Display Value C',
'Storage Value D' => 'Display Value D',
'Storage Value E' => 'Display Value E',
}; |
TicketFreeTextSet()
my $Success = $TicketObject->TicketFreeTextSet(
Counter => 1,
Key => 'Planet', # optional
Value => 'Sun', # optional
TicketID => 123,
UserID => 23,
); |
Events: TicketFreeTextUpdate
TicketFreeTimeSet()
my $Success = $TicketObject->TicketFreeTimeSet(
Counter => 1,
Prefix => 'TicketFreeTime',
TicketFreeTime1Year => 1900,
TicketFreeTime1Month => 12,
TicketFreeTime1Day => 24,
TicketFreeTime1Hour => 22,
TicketFreeTime1Minute => 01,
TicketID => 123,
UserID => 23,
); |
If you want to set a FreeTime value to null, just supply zeros:
my $Success = $TicketObject->TicketFreeTimeSet(
Counter => 1,
Prefix => 'TicketFreeTime',
TicketFreeTime1Year => 0,
TicketFreeTime1Month => 0,
TicketFreeTime1Day => 0,
TicketFreeTime1Hour => 0,
TicketFreeTime1Minute => 0,
TicketID => 123,
UserID => 23,
); |
Events: TicketFreeTimeUpdate
TicketPermission()
my $Access = $TicketObject->TicketPermission(
Type => 'ro',
TicketID => 123,
UserID => 123,
); |
or without logging, for example for to check if a link/action should be shown
my $Access = $TicketObject->TicketPermission(
Type => 'ro',
TicketID => 123,
LogNo => 1,
UserID => 123,
); |
TicketCustomerPermission()
my $Access = $TicketObject->TicketCustomerPermission(
Type => 'ro',
TicketID => 123,
UserID => 123,
); |
or without logging, for example for to check if a link/action should be displayed
my $Access = $TicketObject->TicketCustomerPermission(
Type => 'ro',
TicketID => 123,
LogNo => 1,
UserID => 123,
); |
GetSubscribedUserIDsByQueueID()
my @UserIDs = $TicketObject->GetSubscribedUserIDsByQueueID(
QueueID => 123,
); |
Returns:
@UserIDs = ( 1, 2, 3 ); |
TicketPendingTimeSet()
my $Success = $TicketObject->TicketPendingTimeSet(
Year => 2003,
Month => 08,
Day => 14,
Hour => 22,
Minute => 05,
TicketID => 123,
UserID => 23,
); |
or use a time stamp:
my $Success = $TicketObject->TicketPendingTimeSet(
String => '2003-08-14 22:05:00',
TicketID => 123,
UserID => 23,
); |
If you want to set the pending time to null, just supply zeros:
my $Success = $TicketObject->TicketPendingTimeSet(
Year => 0000,
Month => 00,
Day => 00,
Hour => 00,
Minute => 00,
TicketID => 123,
UserID => 23,
); |
or use a time stamp:
my $Success = $TicketObject->TicketPendingTimeSet(
String => '0000-00-00 00:00:00',
TicketID => 123,
UserID => 23,
); |
Events: TicketPendingTimeUpdate
TicketSearch()
my @TicketIDs = $TicketObject->TicketSearch(
# result (required)
Result => 'ARRAY' || 'HASH' || 'COUNT', |
# result limit
Limit => 100, |
# ticket number (optional) as STRING or as ARRAYREF
TicketNumber => '%123546%',
TicketNumber => ['%123546%', '%123666%'], |
# ticket title (optional) as STRING or as ARRAYREF
Title => '%SomeText%',
Title => ['%SomeTest1%', '%SomeTest2%'], |
Queues => ['system queue', 'other queue'],
QueueIDs => [1, 42, 512], |
# use also sub queues of Queue|Queues in search
UseSubQueues => 0, |
# You can use types like normal, ...
Types => ['normal', 'change', 'incident'],
TypeIDs => [3, 4], |
# You can use states like new, open, pending reminder, ...
States => ['new', 'open'],
StateIDs => [3, 4], |
# (Open|Closed) tickets for all closed or open tickets.
StateType => 'Open', |
# You also can use real state types like new, open, closed,
# pending reminder, pending auto, removed and merged.
StateType => ['open', 'new'],
StateTypeIDs => [1, 2, 3], |
Priorities => ['1 very low', '2 low', '3 normal'],
PriorityIDs => [1, 2, 3], |
Services => ['Service A', 'Service B'],
ServiceIDs => [1, 2, 3], |
SLAs => ['SLA A', 'SLA B'],
SLAIDs => [1, 2, 3], |
Locks => ['unlock'],
LockIDs => [1, 2, 3], |
OwnerIDs => [1, 12, 455, 32] |
ResponsibleIDs => [1, 12, 455, 32] |
WatchUserIDs => [1, 12, 455, 32] |
# CustomerID (optional) as STRING or as ARRAYREF
CustomerID => '123',
CustomerID => ['123', 'ABC'], |
# CustomerUserLogin (optional) as STRING as ARRAYREF
CustomerUserLogin => 'uid123',
CustomerUserLogin => ['uid123', 'uid777'], |
# create ticket properties (optional)
CreatedUserIDs => [1, 12, 455, 32]
CreatedTypes => ['normal', 'change', 'incident'],
CreatedTypeIDs => [1, 2, 3],
CreatedPriorities => ['1 very low', '2 low', '3 normal'],
CreatedPriorityIDs => [1, 2, 3],
CreatedStates => ['new', 'open'],
CreatedStateIDs => [3, 4],
CreatedQueues => ['system queue', 'other queue'],
CreatedQueueIDs => [1, 42, 512], |
# 1..16 (optional)
TicketFreeKey1 => 'Product',
TicketFreeText1 => 'adasd',
# or with multi options as array ref or string possible
TicketFreeKey2 => ['Product', 'Product2'],
TicketFreeText2 => ['Browser', 'Sound', 'Mouse'], |
# 1..6 (optional)
# tickets with free time after ... (optional)
TicketFreeTime1NewerDate => '2006-01-09 00:00:01',
# tickets with free time before ... (optional)
TicketFreeTime1OlderDate => '2006-01-19 23:59:59', |
# search for ticket flags
TicketFlag => {
Seen => 1,
} |
# article stuff (optional)
From => '%spam@example.com%',
To => '%support@example.com%',
Cc => '%client@example.com%',
Subject => '%VIRUS 32%',
Body => '%VIRUS 32%', |
# use full text index if configured (optional, default off)
FullTextIndex => 1, |
# content search (AND or OR) (optional)
ContentSearch => 'AND', |
# content search prefix (optional)
ContentSearchPrefix => '*', |
# content search suffix (optional)
ContentSearchSuffix => '*', |
# content conditions for From,To,Cc,Subject,Body
# Title,CustomerID and CustomerUserLogin (all optional)
ConditionInline => 1, |
# articles created after 60 minutes (article newer than 60 minutes) (optional)
ArticleCreateTimeOlderMinutes => 60,
# articles created before 120 minutes (article older than 120 minutes) (optional)
ArticleCreateTimeNewerMinutes => 120, |
# articles with create time after ... (article newer than this date) (optional)
ArticleCreateTimeNewerDate => '2006-01-09 00:00:01',
# articles with created time before ... (article older than this date) (optional)
ArticleCreateTimeOlderDate => '2006-01-19 23:59:59', |
# tickets created after 60 minutes (ticket newer than 60 minutes) (optional)
TicketCreateTimeOlderMinutes => 60,
# tickets created before 120 minutes (ticket older than 120 minutes) (optional)
TicketCreateTimeNewerMinutes => 120, |
# tickets with create time after ... (ticket newer than this date) (optional)
TicketCreateTimeNewerDate => '2006-01-09 00:00:01',
# tickets with created time before ... (ticket older than this date) (optional)
TicketCreateTimeOlderDate => '2006-01-19 23:59:59', |
# tickets changed after 60 minutes (ticket changed newer than 60 minutes) (optional)
TicketChangeTimeOlderMinutes => 60,
# tickets changed before 120 minutes (ticket changed older 120 minutes) (optional)
TicketChangeTimeNewerMinutes => 120, |
# tickets with changed time after ... (ticket changed newer than this date) (optional)
TicketChangeTimeNewerDate => '2006-01-09 00:00:01',
# tickets with changed time before ... (ticket changed older than this date) (optional)
TicketChangeTimeOlderDate => '2006-01-19 23:59:59', |
# tickets closed after 60 minutes (ticket closed newer than 60 minutes) (optional)
TicketCloseTimeOlderMinutes => 60,
# tickets closed before 120 minutes (ticket closed older than 120 minutes) (optional)
TicketCloseTimeNewerMinutes => 120, |
# tickets with closed time after ... (ticket closed newer than this date) (optional)
TicketCloseTimeNewerDate => '2006-01-09 00:00:01',
# tickets with closed time before ... (ticket closed older than this date) (optional)
TicketCloseTimeOlderDate => '2006-01-19 23:59:59', |
# tickets pending after 60 minutes (optional)
TicketPendingTimeOlderMinutes => 60,
# tickets pending before 120 minutes (optional)
TicketPendingTimeNewerMinutes => 120, |
# tickets with pending time after ... (optional)
TicketPendingTimeNewerDate => '2006-01-09 00:00:01',
# tickets with pending time before ... (optional)
TicketPendingTimeOlderDate => '2006-01-19 23:59:59', |
# you can use all following escalation options with this four different ways of escalations
# TicketEscalationTime...
# TicketEscalationUpdateTime...
# TicketEscalationResponseTime...
# TicketEscalationSolutionTime... |
# ticket escalations over 60 minutes (optional)
TicketEscalationTimeOlderMinutes => -60,
# ticket escalations in 120 minutes (optional)
TicketEscalationTimeNewerMinutes => -120, |
# tickets with escalation time after ... (optional)
TicketEscalationTimeNewerDate => '2006-01-09 00:00:01',
# tickets with escalation time before ... (optional)
TicketEscalationTimeOlderDate => '2006-01-09 23:59:59', |
# search in archive (optional)
ArchiveFlags => ['y', 'n'], |
# OrderBy and SortBy (optional)
OrderBy => 'Down', # Down|Up
SortBy => 'Age', # Owner|Responsible|CustomerID|State|TicketNumber|Queue|Priority|Age|Type|Lock
# Title|Service|SLA|PendingTime|EscalationTime
# EscalationUpdateTime|EscalationResponseTime|EscalationSolutionTime
# TicketFreeTime1-6|TicketFreeKey1-16|TicketFreeText1-16 |
# OrderBy and SortBy as ARRAY for sub sorting (optional)
OrderBy => ['Down', 'Up'],
SortBy => ['Priority', 'Age'], |
# user search (UserID is required)
UserID => 123,
Permission => 'ro' || 'rw', |
# customer search (CustomerUserID is required)
CustomerUserID => 123,
Permission => 'ro' || 'rw', |
# CacheTTL, cache search result in seconds (optional)
CacheTTL => 60 * 15,
); |
Returns:
Result: 'ARRAY' |
@TicketIDs = ( 1, 2, 3 ); |
Result: 'HASH' |
%TicketIDs = (
1 => '2010102700001',
2 => '2010102700002',
3 => '2010102700003',
); |
Result: 'COUNT' |
$TicketIDs = 123; |
TicketLockGet()
if ($TicketObject->TicketLockGet(TicketID => 123)) {
print "Ticket is locked!\n";
}
else {
print "Ticket is not locked!\n";
} |
TicketLockSet()
my $Success = $TicketObject->TicketLockSet(
Lock => 'lock',
TicketID => 123,
UserID => 123,
); |
my $Success = $TicketObject->TicketLockSet(
LockID => 1,
TicketID => 123,
UserID => 123,
); |
Optional attribute:
SendNoNotification, disable or enable agent and customer notification for this
action. Otherwise a notification will be send to agent and cusomer. |
For example: |
SendNoNotification => 0, # optional 1|0 (send no agent and customer notification) |
Events: TicketLockUpdate
TicketArchiveFlagSet()
my $Success = $TicketObject->TicketArchiveFlagSet(
ArchiveFlag => 'y', # (y|n)
TicketID => 123,
UserID => 123,
); |
Events: TicketArchiveFlagUpdate
TicketStateSet()
my $Success = $TicketObject->TicketStateSet(
State => 'open',
TicketID => 123,
UserID => 123,
); |
my $Success = $TicketObject->TicketStateSet(
StateID => 3,
TicketID => 123,
UserID => 123,
); |
Optional attribute:
SendNoNotification, disable or enable agent and customer notification for this
action. Otherwise a notification will be send to agent and cusomer. |
For example: |
SendNoNotification => 0, # optional 1|0 (send no agent and customer notification) |
Events: TicketStateUpdate
TicketStateList()
my %States = $TicketObject->TicketStateList(
TicketID => 123,
UserID => 123,
); |
my %States = $TicketObject->TicketStateList(
QueueID => 123,
UserID => 123,
); |
my %States = $TicketObject->TicketStateList(
TicketID => 123,
Type => 'open',
UserID => 123,
); |
Returns:
%States = (
1 => 'State A',
2 => 'State B',
3 => 'State C',
); |
OwnerCheck()
my ($OwnerID, $Owner) = $TicketObject->OwnerCheck(
TicketID => 123,
); |
or for access control
my $AccessOk = $TicketObject->OwnerCheck(
TicketID => 123,
OwnerID => 321,
); |
TicketOwnerSet()
by using user id |
my $Success = $TicketObject->TicketOwnerSet(
TicketID => 123,
NewUserID => 555,
UserID => 123,
); |
by using user login |
my $Success = $TicketObject->TicketOwnerSet(
TicketID => 123,
NewUser => 'some-user-login',
UserID => 123,
); |
Return:
1 = owner has been set
2 = this owner is already set, no update needed |
Optional attribute:
SendNoNotification, disable or enable agent and customer notification for this
action. Otherwise a notification will be send to agent and cusomer. |
For example: |
SendNoNotification => 0, # optional 1|0 (send no agent and customer notification) |
Events: TicketOwnerUpdate
TicketOwnerList()
my @Owner = $TicketObject->TicketOwnerList(
TicketID => 123,
); |
Returns:
@Owner = (
{
UserFirstname => 'SomeName',
UserLastname => 'SomeName',
UserEmail => 'some@example.com',
# custom attributes
},
{
UserFirstname => 'SomeName',
UserLastname => 'SomeName',
UserEmail => 'some@example.com',
# custom attributes
},
); |
TicketResponsibleSet()
my $Success = $TicketObject->TicketResponsibleSet(
TicketID => 123,
NewUserID => 555,
UserID => 213,
); |
Return:
1 = responsible has been set
2 = this responsible is already set, no update needed |
Optional attribute:
SendNoNotification, disable or enable agent and customer notification for this
action. Otherwise a notification will be send to agent and cusomer. |
For example: |
SendNoNotification => 0, # optional 1|0 (send no agent and customer notification) |
Events: TicketResponsibleUpdate
TicketResponsibleList()
my @Responsible = $TicketObject->TicketResponsibleList(
TicketID => 123,
); |
Returns:
@Responsible = (
{
UserFirstname => 'SomeName',
UserLastname => 'SomeName',
UserEmail => 'some@example.com',
# custom attributes
},
{
UserFirstname => 'SomeName',
UserLastname => 'SomeName',
UserEmail => 'some@example.com',
# custom attributes
},
); |
TicketInvolvedAgentsList()
my @InvolvedAgents = $TicketObject->TicketInvolvedAgentsList(
TicketID => 123,
); |
Returns:
@InvolvedAgents = (
{
UserFirstname => 'SomeName',
UserLastname => 'SomeName',
UserEmail => 'some@example.com',
# custom attributes
},
{
UserFirstname => 'SomeName',
UserLastname => 'SomeName',
UserEmail => 'some@example.com',
# custom attributes
},
); |
TicketPrioritySet()
my $Success = $TicketObject->TicketPrioritySet(
TicketID => 123,
Priority => 'low',
UserID => 213,
); |
my $Success = $TicketObject->TicketPrioritySet(
TicketID => 123,
PriorityID => 2,
UserID => 213,
); |
Events: TicketPriorityUpdate
TicketPriorityList()
my %Priorities = $TicketObject->TicketPriorityList(
TicketID => 123,
UserID => 123,
); |
my %Priorities = $TicketObject->TicketPriorityList(
QueueID => 123,
UserID => 123,
); |
Returns:
%Priorities = (
1 => 'Priority A',
2 => 'Priority B',
3 => 'Priority C',
); |
HistoryTicketStatusGet()
my %Tickets = $TicketObject->HistoryTicketStatusGet(
StartDay => 12,
StartMonth => 1,
StartYear => 2006,
StopDay => 18,
StopMonth => 1,
StopYear => 2006,
Force => 0,
); |
HistoryTicketGet()
my %HistoryData = $TicketObject->HistoryTicketGet(
StopYear => 2003,
StopMonth => 12,
StopDay => 24,
TicketID => 123,
Force => 0,
); |
returns
TicketNumber
TicketID
Type
TypeID
Queue
QueueID
Priority
PriorityID
State
StateID
Owner
OwnerID
CreateUserID
CreateTime (timestamp)
CreateOwnerID
CreatePriority
CreatePriorityID
CreateState
CreateStateID
CreateQueue
CreateQueueID
LockFirst (timestamp)
LockLast (timestamp)
UnlockFirst (timestamp)
UnlockLast (timestamp) |
HistoryTypeLookup()
my $ID = $TicketObject->HistoryTypeLookup( Type => 'Move' ); |
HistoryAdd()
my $Success = $TicketObject->HistoryAdd(
Name => 'Some Comment',
HistoryType => 'Move', # see system tables
TicketID => 123,
ArticleID => 1234, # not required!
QueueID => 123, # not required!
TypeID => 123, # not required!
CreateUserID => 123,
); |
Events: HistoryAdd
HistoryGet()
my @HistoryLines = $TicketObject->HistoryGet(
TicketID => 123,
UserID => 123,
); |
HistoryDelete()
my $Success = $TicketObject->HistoryDelete(
TicketID => 123,
UserID => 123,
); |
Events: HistoryDelete
TicketAccountedTimeGet()
my $AccountedTime = $TicketObject->TicketAccountedTimeGet(TicketID => 1234); |
TicketAccountTime()
my $Success = $TicketObject->TicketAccountTime(
TicketID => 1234,
ArticleID => 23542,
TimeUnit => '4.5',
UserID => 1,
); |
Events: TicketAccountTime
TicketMerge()
my $Success = $TicketObject->TicketMerge(
MainTicketID => 412,
MergeTicketID => 123,
UserID => 123,
); |
Events: TicketMerge
TicketWatchGet()
my %Watch = $TicketObject->TicketWatchGet(
TicketID => 123,
); |
get list of users to notify
my %Watch = $TicketObject->TicketWatchGet(
TicketID => 123,
Notify => 1,
); |
get list of users as array
my Watch = $TicketObject->TicketWatchGet(
TicketID => 123,
Result => 'ARRAY',
); |
TicketWatchSubscribe()
my $Success = $TicketObject->TicketWatchSubscribe(
TicketID => 111,
WatchUserID => 123,
UserID => 123,
); |
Events: TicketSubscribe
TicketWatchUnsubscribe()
my $Success = $TicketObject->TicketWatchUnsubscribe(
TicketID => 111,
WatchUserID => 123,
UserID => 123,
); |
Events: TicketUnsubscribe
TicketFlagSet()
my $Success = $TicketObject->TicketFlagSet(
TicketID => 123,
Key => 'seen',
Value => 1,
UserID => 123,
); |
Events: TicketFlagSet
TicketFlagDelete()
my $Success = $TicketObject->TicketFlagDelete(
TicketID => 123,
Key => 'seen',
UserID => 123,
); |
Events: TicketFlagDelete
TicketFlagGet()
my %Flags = $TicketObject->TicketFlagGet(
TicketID => 123,
UserID => 123,
); |
TicketAcl()
$TicketObject->TicketAcl(
Data => '-',
Action => 'AgentTicketZoom',
TicketID => 123,
ReturnType => 'Action',
ReturnSubType => '-',
UserID => 123,
); |
or |
$TicketObject->TicketAcl(
Data => {
1 => 'new',
2 => 'open',
# ...
},
ReturnType => 'Ticket',
ReturnSubType => 'State',
) |
TicketAclData()TicketAcl()
my %Acl = $TicketObject->TicketAclData(); |
TicketAclActionData()TicketAcl()
my %AclAction = $TicketObject->TicketAclActionData(); |
This software is part of the OTRS project (http://otrs.org/).
This software comes with ABSOLUTELY NO WARRANTY. For details, see the enclosed file COPYING for license information (AGPL). If you did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
$Revision: 1.468 $ $Date: 2010/08/19 13:22:58 $