[SOLVED] Kernel::System::Ticket->TicketGet() Fields

Moderator: crythias

Locked
ossys
Znuny newbie
Posts: 8
Joined: 11 Dec 2014, 20:19
Znuny Version: 3.1.12
Real Name: Chad Cravens
Company: Open Source Systems, LLC

[SOLVED] Kernel::System::Ticket->TicketGet() Fields

Post by ossys »

I'm working with the Kernel::System::Ticket API as defined here:
http://otrs.github.io/doc/api/otrs/3.3/ ... et.pm.html

I'm getting the ticket as follows:

Code: Select all

$Self->{TicketObject} = Kernel::System::Ticket->new( %Param );
my %TicketInfo = $Self->{TicketObject}->TicketGet(
   TicketID => $Param{Data}->{TicketID},
   UserID => 1,
);
And I'm able to get information regarding that ticket using:

Code: Select all

$TicketInfo{Priority}
I can't help but notice that the Ticket object I'm returned does not contain the text body of the Ticket! I have poured through the API documentation and passed additional fields to the TicketGet() methods such as "DynamicFields => 0," and "Extended => 1,". However, I'm still unable to see how to retrieve what the person actually typed in the "Text" field of the ticket. I would expect something like:

Code: Select all

$TicketInfo{Text}
But it is not there.... How can I get this field from the Ticket object that I'm pulling?

Thanks!
Last edited by ossys on 17 Dec 2014, 03:39, edited 1 time in total.
eandrex
Znuny expert
Posts: 213
Joined: 04 Nov 2012, 23:58
Znuny Version: OTRS 4.x
Real Name: Esteban
Company: NORTON DE COLOMBIA

Re: Kernel::System::Ticket->TicketGet() Fields

Post by eandrex »

from
http://otrs.github.io/doc/api/otrs/3.3/ ... le.pm.html
you can use

Code: Select all

my %FirstArticle = $Self->{TicketObject}->ArticleFirstArticle(
  TicketID => $Param{Data}->{TicketID},
);
now in %FirstArticle you would have
$FirstArticle{From}
$FirstArticle{Subject}
$FirstArticle{Body}
...
hope it helps
ossys
Znuny newbie
Posts: 8
Joined: 11 Dec 2014, 20:19
Znuny Version: 3.1.12
Real Name: Chad Cravens
Company: Open Source Systems, LLC

Re: Kernel::System::Ticket->TicketGet() Fields

Post by ossys »

Yes that's exactly what I needed, thank you very much for the assistance!!
Locked