dashboard Dynamic Field Value

Moderator: crythias

Locked
Kuba
Znuny newbie
Posts: 13
Joined: 19 Jul 2013, 11:45
Znuny Version: 3.2.9

dashboard Dynamic Field Value

Post by Kuba »

Hi,
just quick question. I have added dynamicfield to my dashboard (it's a dropdown) in AgentDashboardTicketGeneric.dtl :

<td>$QData{"DynamicField_TicketState"}</td>

And it shows the Key instead of the actual Value (Key: "1" Value "1. Some State")

I've been trying with DynamicField_TicketState_Value without any luck. Can you please help me?

Kuba
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: dashboard Dynamic Field Value

Post by crythias »

make key = value
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
Kuba
Znuny newbie
Posts: 13
Joined: 19 Jul 2013, 11:45
Znuny Version: 3.2.9

Re: dashboard Dynamic Field Value

Post by Kuba »

Thanks. That was my first guess. But I wonder if I can show those values. Defining value as a key will not work with the system I’m integrating with (there I have tables with integer keys). Off course I can set some kind of translation between those 2 systems, but I thought it will be much easier to change that in OTRS.

Regards,
Kuba
Kuba
Znuny newbie
Posts: 13
Joined: 19 Jul 2013, 11:45
Znuny Version: 3.2.9

Re: dashboard Dynamic Field Value

Post by Kuba »

I think I have found the solution. My Perl skills are VERY basic, so probably there is much better way, but this might provide some advice if anyone wants to do this.

I have modyfied Kernel/System/Ticket.pl (around line 1178)

Code: Select all

# set the dynamic field name and value into the ticket hash
$Ticket{ 'DynamicField_' . $DynamicFieldConfig->{Name} } = $Value;

#set the dynamic field with value from PossibleValues (DF: dropdown) 
if ( IsHashRefWithData($DynamicFieldConfig->{Config}->{PossibleValues}) ){
		my %PossibleValues = %{ $DynamicFieldConfig->{Config}->{PossibleValues} };
		$Ticket{ 'DynamicField_' . $DynamicFieldConfig->{Name} .'_Value'} = $PossibleValues{$Value};
}
else {
	$Ticket{ 'DynamicField_' . $DynamicFieldConfig->{Name} .'_Value'} = $Value;
}
Regards,
Kuba
Locked