How to get the value of a dynamic field in an event module

Hello, I want to run an action , using event, according to the value of a dynamic field ( dynamic field is a check box, let say "IsCompanyTicket") The current situation : dynamic field created and associated to Customer::Frontend new ConfigItem added in Kernel/Config/Files/Ticket.xml Event module created in Kernel/System/Ticket/Event/ In that module, I can see (print) the dynamic Field name DynamicField_IsCompanyTicket, th'at's ok but I DON'T know how to get the value I meant that something like : my $df_value = $Ticket{DynamicField_IsCompanyTicket}; doesn't work, I got no value I have tried with checkbox but also textfield. I don't kown where to look for in documentation ? Best regards. --------------- Bernard CHAMBON IN2P3 / CNRS 04 72 69 42 18

Hello Bernard, the support of dynamic field Values in the ticket object seems to be completely missing, I opened a bug a couple of days ago, I think your issue is related to mine: http://bugs.otrs.org/show_bug.cgi?id=8551 Cheers, David Am 14.06.12 12:12, schrieb Bernard Chambon:
Hello,
I want to run an action , using event, according to the value of a dynamic field ( dynamic field is a check box, let say "IsCompanyTicket")
The current situation : dynamic field created and associated to Customer::Frontend new ConfigItem added in Kernel/Config/Files/Ticket.xml Event module created in Kernel/System/Ticket/Event/
In that module, I can see (print) the dynamic Field name DynamicField_IsCompanyTicket, th'at's ok * but I DON'T know how to get the value* I meant that something like : /my $df_value = $Ticket{DynamicField_IsCompanyTicket};
/ / doesn't work, /I got no value I have tried with checkbox but also textfield.
I don't kown where to look for in documentation ?
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

Hi Bernard, just use TicketGet(...., DynamicFields => 1); and you will get all fields on the result hash. Regards, mg Am 14.06.12 12:12, schrieb Bernard Chambon:
Hello,
I want to run an action , using event, according to the value of a dynamic field ( dynamic field is a check box, let say "IsCompanyTicket")
The current situation : dynamic field created and associated to Customer::Frontend new ConfigItem added in Kernel/Config/Files/Ticket.xml Event module created in Kernel/System/Ticket/Event/
In that module, I can see (print) the dynamic Field name DynamicField_IsCompanyTicket, th'at's ok * but I DON'T know how to get the value* I meant that something like : / my $df_value = $Ticket{DynamicField_IsCompanyTicket};
/ / doesn't work, /I got no value I have tried with checkbox but also textfield.
I don't kown where to look for in documentation ?
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
-- Martin Gruner Senior Developer R&D OTRS AG Europaring 4 94315 Straubing T: +49 (0)6172 681988 0 F: +49 (0)9421 56818 18 I: www.otrs.com/ Geschäftssitz: Bad Homburg, Amtsgericht: Bad Homburg, HRB 10751, USt-Nr.: DE256610065 Aufsichtsratsvorsitzender: Burchard Steinbild, Vorstand: André Mindermann (Vorsitzender), Christopher Kuhn Verbinden wir uns! OTRS 3.1 schafft einfachere Integration mit Drittapplikationen -- Für Frühbucher zum Vorzugspreis: http://www.otrs.com/index.php?id=2361&L=1

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

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

Hello, Le 16 juin 2012 à 20:46, Michiel Beijen a écrit :
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.
Thank you for that help. now other question : using several dyn fields, Is there a way to known which one has been modified Or do I have to process all dynamic fields, even if only one has changed (I mean now using event, still working with generic Agent.) Best regards --------------- Bernard CHAMBON IN2P3 / CNRS 04 72 69 42 18

Hi Bernard,
On Wed, Jun 27, 2012 at 3:26 PM, Bernard Chambon
now other question : using several dyn fields, Is there a way to known which one has been modified Or do I have to process all dynamic fields, even if only one has changed (I mean now using event, still working with generic Agent.)
You can bind to the event for this specific field. If your register your event module for the event TicketDynamicFieldUpdate_IsCompanyTicket it would only be triggered if this field is updated. Kindest regards, Michiel Beijen Senior Consultant OTRS BV Schipholweg 103 2316 XC Leiden The Netherlands T: +31 71 8200 255 F: +31 71 8200 254 I: http://www.otrs.com Get Connected ! Everything in sync with OTRS 3.1- Be an early bird with our special offer: http://j.mp/xN9wk1

Hello, I want to create several 'Dropdown' dynamic fields with many values each one Is it possible to do it without the GUI ? (too tedious !) The main question is where are stored the values ? I create one with 2 values , but I can find where they are ? Not in dynamic_field_value ? mysql> select * from dynamic_field_value ; Empty set (0.00 sec) The only entry is in dynamic_field mysql> select * from dynamic_field where ... *************************** 1. row *************************** id: 10 name: ToTestStorageInDB label: ToTestStorageInDB field_order: 9 field_type: Dropdown object_type: Ticket config: --- DefaultValue: '' Link: '' PossibleNone: 0 PossibleValues: Key1: Value1 Key2: Value2 TranslatableValues: 0 valid_id: 1 create_time: 2012-06-21 12:14:48 create_by: 1 change_time: 2012-06-21 12:14:48 change_by: 1 1 row in set (0.00 sec) I did not find anything in otrs/bin/ Best regards --------------- Bernard CHAMBON IN2P3 / CNRS 04 72 69 42 18

Hello, And sorry, I need a pair of glasses ! The values are stores in the dynamic_field table see BLOB column ' config'
config: --- DefaultValue: '' Link: '' PossibleNone: 0 PossibleValues: Key1: Value1 Key2: Value2 TranslatableValues: 0
sorry for the (previous) spam Regards Le 21 juin 2012 à 12:50, Bernard Chambon a écrit :
Hello,
I want to create several 'Dropdown' dynamic fields with many values each one Is it possible to do it without the GUI ? (too tedious !)
The main question is where are stored the values ? I create one with 2 values , but I can find where they are ? Not in dynamic_field_value ? mysql> select * from dynamic_field_value ; Empty set (0.00 sec)
The only entry is in dynamic_field
mysql> select * from dynamic_field where ... *************************** 1. row *************************** id: 10 name: ToTestStorageInDB label: ToTestStorageInDB field_order: 9 field_type: Dropdown object_type: Ticket config: --- DefaultValue: '' Link: '' PossibleNone: 0 PossibleValues: Key1: Value1 Key2: Value2 TranslatableValues: 0
valid_id: 1 create_time: 2012-06-21 12:14:48 create_by: 1 change_time: 2012-06-21 12:14:48 change_by: 1 1 row in set (0.00 sec)
I did not find anything in otrs/bin/
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
--------------- Bernard CHAMBON IN2P3 / CNRS 04 72 69 42 18
participants (5)
-
Bernard Chambon
-
David Heidt
-
Martin Gruner
-
Michiel Beijen
-
Michiel Beijen