I am new in OTRS and Perl Programming.
I would like to ask if there is a way to enrich the FullText Search Attributes.
As I have understood the OTRS FullText Search in the Toolbar searches for the given value in attribute fields - From To Cc Subject Body and TicketID - of a Ticket.
OTRS\Kernel\Modules\AgentTicketSearch.pm
my $TicketID = $Self->{TicketObjectSearch}->TicketIDLookup(
TicketNumber => $GetParam{Fulltext},
UserID => $Self->{UserID},
);
if ($TicketID) {
return $Self->{LayoutObject}->Redirect(
OP => "Action=AgentTicketZoom;TicketID=$TicketID",
);
}
}
# prepare full text search
if ( $GetParam{Fulltext} ) {
$GetParam{ContentSearch} = 'OR';
for (qw(From To Cc Subject Body)) {
$GetParam{$_} = $GetParam{Fulltext};
}
}
I would like to make it search on the ticket's Dynamic Fields created by the user.
I have seen that search on a Dynamic Field can be done in the GlobalSearchNav by creating a Search Profile where a Dynamic Field can be added to the Search Attributes through SysConfig' s module Ticket -> Frontend::Agent::Ticket::ViewSearch.
Is there a way to add a Dynamic Field in the search attribute fields of the Fulltext search module in Toolbar?
Could this be done through the SysConfig panel or should i have to change the code in the OTRS\Kernel\Modules\AgentTicketSearch.pm ( Agent Search Router for OTRS ), OTRS\Kernel\System\TicketSearch.pm, OTRS\Kernel\Output\HTML\ToolBarTicketSearchFulltext.pm ...
Thanks in advance for your time
Add Dynamic Fields search in Fulltext ToolBarTicketSearch
Re: Add Dynamic Fields search in Fulltext ToolBarTicketSearc
I think I would try to use the already existing functionality of searching in DynamicFields:
FieldNameX being the name of the dynamic field you want to search... if there are more than one DF:
where X, Y and Z are the names of the DF's you want to search...
But be careful, full text search is commonly used and this addition may harm your performance.
Code: Select all
if ( $GetParam{Fulltext} ) {
for (qw(From To Cc Subject Body)) {
$GetParam{$_} = $GetParam{Fulltext};
}
$GetParam{DynamicField_FieldNameX}->Like = $GetParam{Fulltext};
}
Code: Select all
if ( $GetParam{Fulltext} ) {
for (qw(From To Cc Subject Body)) {
$GetParam{$_} = $GetParam{Fulltext};
}
for my $DF ( qw( X Y Z ) ){
$GetParam {'DynamicField_' . $DF }->Like =
$GetParam{Fulltext};
}
}
But be careful, full text search is commonly used and this addition may harm your performance.
OTRS 5.0.15 on CentOSLinux with MariaDB database connected to an Active Directory for Agents and Customers.
-
- Znuny newbie
- Posts: 11
- Joined: 13 Sep 2019, 19:15
- Znuny Version: 6.0
Re: Add Dynamic Fields search in Fulltext ToolBarTicketSearch
Any idea how that works with an OTRS 6 installation?