
Hi Bernard,
Typically you dump the contents of data structures with a module like
Data::Dumper.
So if you'd take the file bin/otrs.GetTicketThread.pl which is on your OTRS
system, this utility prints out a ticket to the screen.
If you would open this file in a text editor, set DynamicFields to '1' and
then add, at the end of the file, these two lines:
use Data::Dumper;
print Dumper (\%Ticket);
and then run bin/otrs.GetTicketThread.pl [TicketID] on the command line, it
will present the contents of the TicketGet() call.
I created a dynamic field on a ticket called 'MyTicketField' and you see it
returned, in my case even on the very top of the hash:
=====================================================================
TicketNumber: 2012061610000043
TicketID: 984
Created: 2012-06-16 20:37:27
Queue: Postmaster
State: open
Priority: 3 normal
Lock: unlock
---------------------------------------------------------------------
ArticleID: 6427
From: OTRS System
Hi,
Le 15 juin 2012 à 15:58, Martin Gruner a écrit :
Hi Bernard,
just use TicketGet(...., DynamicFields => 1); and you will get all fields on the result hash.
Regards, mg
In fact I have made a call with DynamicFields => 1 but the problem is that I get the name of the field *but not the value*
small piece of code :
* my %Ticket = $Self->{TicketObject}->TicketGet(* * TicketID => $Param{TicketID},* * UserID => 1,* * DynamicFields => 1, # To get DynamicFields in Ticket map* * );* * return 1 if !%Ticket;* * * * while( my ($k,$v) = each(%Ticket) ) {* * $Self->{LogObject}->Log( Priority => 'info', Message => "key=$k value=$v" );* * }* * $Self->{LogObject}->Log( Priority => 'info', Message => "End of my own module" );* * * gives :
*[Fri Jun 15 17:48:19 2012][Info][Kernel::System::Ticket::Event::EventModuleIsCompanyTicket::Run] key=CreateTimeUnix value=1339775299* *[Fri Jun 15 17:48:19 2012][Info][Kernel::System::Ticket::Event::EventModuleIsCompanyTicket::Run] key=SLAID value=* *[Fri Jun 15 17:48:19 2012][Info][Kernel::System::Ticket::Event::EventModuleIsCompanyTicket::Run] key=CustomerUserID value=bchambonascustomer* *[Fri Jun 15 17:48:19 2012][Info][Kernel::System::Ticket::Event::EventModuleIsCompanyTicket::Run] key=DynamicField_IsCompanyTicket value=* *[Fri Jun 15 17:48:19 2012][Info][Kernel::System::Ticket::Event::EventModuleIsCompanyTicket::Run] End of my own module*
I also have other problem with events I can fire an event with 'TicketCreate' (as in my previous example) but I CAN'T fire anything when moving Ticket between queue. I have tried several EventName (see below), without result
* <ConfigItem Name="Ticket::EventModulePost###EventModuleIsCompanyTicket" Required="0" Valid="1">* * <Description Translatable="1">To set a ticket as private ...</Description>* * <Group>Ticket</Group>* * <SubGroup>Core::Ticket</SubGroup>* * <Setting>* * <Hash>* * <Item Key="Module">Kernel::System::Ticket::Event::EventModuleIsCompanyTicket</Item> * * <!-- Event fired with TicketCreate, but can't get Value from DynamicField --> * * <!-- <Item Key="Event">TicketCreate</Item> -->* * * * <!-- Can't fire an event on TicketQueueUpdate , an Event Name problem or something else ? --> * * <Item Key="Event">TicketQueueUpdate|TicketMoveTicket|MoveTicket</Item> * * <Item Key="new">open</Item>* * </Hash>* * </Setting>* * </ConfigItem>*
however , with notification (sending email for ex) '*TicketQueueUpdate' seems to work* * * hoping better for next week... Best regards
--------------- Bernard CHAMBON IN2P3 / CNRS 04 72 69 42 18
--------------------------------------------------------------------- OTRS mailing list: otrs - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/pipermail/otrs To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs