OTRS_TICKET_* Notification Event

Dont create your support topics here! No new topics with questions allowed!

Moderator: crythias

Forum rules
Dont create your support topics here! No new topics with questions allowed!
Post Reply
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

OTRS_TICKET_* Notification Event

Post by crythias »

What can you use in Notification (Event)? Anything that TicketGet returns, apparently
Source: otrs/Kernel/System/Ticket/Event/NotificationEvent.pm

Code: Select all

    # ticket data
    my %Ticket = $Self->{TicketObject}->TicketGet( TicketID => $Param{TicketID} );
    for ( keys %Ticket ) {
        next if !defined $Ticket{$_};
        $Notification{Body}    =~ s/<OTRS_TICKET_$_>/$Ticket{$_}/gi;
        $Notification{Subject} =~ s/<OTRS_TICKET_$_>/$Ticket{$_}/gi;
    }
TicketGet returns, and you should prepend OTRS_TICKET_ to the appropriate field: (source: Kernel/System/Ticket.pm)

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")
);
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
checo911mx
Znuny newbie
Posts: 76
Joined: 21 Sep 2011, 23:57
Znuny Version: 3
Real Name: Sergio
Company: cbt
Location: Mexico, D.F.

Re: OTRS_TICKET_* Notification Event

Post by checo911mx »

Hi Crythias
Can i add the standard signature to notifications?
have a flag about this?
bitos
Znuny newbie
Posts: 34
Joined: 27 Nov 2013, 17:27
Znuny Version: 3.2.7

Re: OTRS_TICKET_* Notification Event

Post by bitos »

Hi Crythias,

According to https://github.com/OTRS/otrs/blob/maste ... /Ticket.pm

It is possible to get extended attributes using TicketGet.

Code: Select all

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)
    );
Can we use this somehow to get these extended attributes in Notification (Event)?
For example <OTRS_TICKET_EXTENDED_FirstResponse> ?

I'd like to inform customers with an SLA of the FirstResponse and SolutionTime in an automatically sent Notification, but it looks like all the escalation attributes in TicketGet aren't set?
OTRS 3.3.3 on Cent0S 6.5 using MySQL.
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: OTRS_TICKET_* Notification Event

Post by crythias »

If you want to use extended attributes follow the API.

That includes passing Extended =>1 as a Parameter to TicketGet
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Post Reply