Add a dynamic field in the search result (CSV)
Moderator: crythias
-
- Znuny newbie
- Posts: 59
- Joined: 24 Jul 2012, 18:20
- Znuny Version: 3.1.7
- Real Name: Girish Mungra
Add a dynamic field in the search result (CSV)
How can I add a dynamic field in the search result (CSV) for an Agent Ticket Search?
In sysconfig i went there:
Ticket -> Frontend::Agent::Ticket::ViewSearch
Ticket::Frontend::AgentTicketSearch###SearchCSVData
and added
DynamicField_field12 in the list.
didn't work..
thanks for help
In sysconfig i went there:
Ticket -> Frontend::Agent::Ticket::ViewSearch
Ticket::Frontend::AgentTicketSearch###SearchCSVData
and added
DynamicField_field12 in the list.
didn't work..
thanks for help
OTRS 3.1.7 on Linux RedHat with MySQL database connected to an Active Directory for Agents and Customers.
-
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Add a dynamic field in the search result (CSV)
look a little lower on the page.
The appropriate code (Kernel/Modules/AgentTicketSearch.pm) :
That seems interesting ... there must be a CSVDynamicField config...
Sure enough, it's the last entry on the page.
The appropriate code (Kernel/Modules/AgentTicketSearch.pm) :
Code: Select all
# include the selected dynamic fields on CVS resutls
DYNAMICFIELD:
for my $DynamicFieldConfig ( @{ $Self->{CSVDynamicField} } ) {
next DYNAMICFIELD if !IsHashRefWithData($DynamicFieldConfig);
next DYNAMICFIELD if !$DynamicFieldConfig->{Name};
next DYNAMICFIELD if $DynamicFieldConfig->{Name} eq '';
push @CSVHead, 'DynamicField_' . $DynamicFieldConfig->{Name};
}
}
Sure enough, it's the last entry on the page.
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
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
-
- Znuny newbie
- Posts: 59
- Joined: 24 Jul 2012, 18:20
- Znuny Version: 3.1.7
- Real Name: Girish Mungra
Re: Add a dynamic field in the search result (CSV)
hi
from the code i deduce that field I should add in the config should start with 'DynamicField_ '. And this exactly what I did at first but doesn't work
from the code i deduce that field I should add in the config should start with 'DynamicField_ '. And this exactly what I did at first but doesn't work

Code: Select all
my @Data;
for (@CSVHead) {
# check if header is a dynamic field and get the value from dynamic field
# backend
if ( $_ =~ m{\A DynamicField_ ( [a-zA-Z\d]+ ) \z}xms ) {
# loop over the dynamic fields configured for CSV output
DYNAMICFIELD:
for my $DynamicFieldConfig ( @{ $Self->{CSVDynamicField} } ) {
next DYNAMICFIELD if !IsHashRefWithData($DynamicFieldConfig);
next DYNAMICFIELD if !$DynamicFieldConfig->{Name};
# skip all fields that does not match with current field name ($1)
# with out the 'DynamicField_' prefix
next DYNAMICFIELD if $DynamicFieldConfig->{Name} ne $1;
# get the value as for print (to corretly display)
my $ValueStrg = $Self->{BackendObject}->DisplayValueRender(
DynamicFieldConfig => $DynamicFieldConfig,
Value => $Info{$_},
HTMLOutput => 0,
LayoutObject => $Self->{LayoutObject},
);
OTRS 3.1.7 on Linux RedHat with MySQL database connected to an Active Directory for Agents and Customers.
-
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Add a dynamic field in the search result (CSV)
How did you deduce that? The code push @CSVHead, 'DynamicField_' . $DynamicFieldConfig->{Name}; adds DynamicField_ to the entries in the CSV section at the bottom of the Config page.girishmungra wrote:from the code i deduce that field I should add in the config should start with 'DynamicField_ '
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
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
-
- Znuny newbie
- Posts: 59
- Joined: 24 Jul 2012, 18:20
- Znuny Version: 3.1.7
- Real Name: Girish Mungra
Re: Add a dynamic field in the search result (CSV)
Looks like I still haven't seen how to add my dynamic field in Ticket::Frontend::AgentTicketSearch###SearchCSVData
OTRS 3.1.7 on Linux RedHat with MySQL database connected to an Active Directory for Agents and Customers.
-
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Add a dynamic field in the search result (CSV)
Click the (+).
Type your field name in key. (This should be the name without DynamicField_)
add 1 to "content"
this will make it export.
To search on it, do the same thing for
Ticket::Frontend::AgentTicketSearch###DynamicField
Type your field name in key. (This should be the name without DynamicField_)
add 1 to "content"
this will make it export.
To search on it, do the same thing for
Ticket::Frontend::AgentTicketSearch###DynamicField
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
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
-
- Znuny newbie
- Posts: 59
- Joined: 24 Jul 2012, 18:20
- Znuny Version: 3.1.7
- Real Name: Girish Mungra
Re: Add a dynamic field in the search result (CSV)
But there is no 'content' column in Ticket::Frontend::AgentTicketSearch###SearchCSVData
Its just a list of data to export in CSV format.
I tried without the DynamicFiled_ but doesn't work.
Its just a list of data to export in CSV format.
I tried without the DynamicFiled_ but doesn't work.
OTRS 3.1.7 on Linux RedHat with MySQL database connected to an Active Directory for Agents and Customers.
-
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Add a dynamic field in the search result (CSV)
What do you see on your screen?
You do not have the required permissions to view the files attached to this post.
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
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
-
- Znuny newbie
- Posts: 59
- Joined: 24 Jul 2012, 18:20
- Znuny Version: 3.1.7
- Real Name: Girish Mungra
[SOLVED] Re: Add a dynamic field in the search result (CSV)
I am a plum! didn't notice that config.
Many thanks - was able to export my dynamic fields
Many thanks - was able to export my dynamic fields
OTRS 3.1.7 on Linux RedHat with MySQL database connected to an Active Directory for Agents and Customers.
-
- Znuny newbie
- Posts: 8
- Joined: 17 Nov 2014, 14:06
- Znuny Version: 3.1.11
- Real Name: Seweryn
- Company: Concordia
Re: Add a dynamic field in the search result (CSV)
Hi,
I have similar problem but only with non-text type dynamic fields.
In csv I always get the empty columny (for e.g. drop down list).
Do you know some resolution for this problem?
Thanks for help!
Best regards
I have similar problem but only with non-text type dynamic fields.
In csv I always get the empty columny (for e.g. drop down list).
Do you know some resolution for this problem?
Thanks for help!
Best regards