Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to use dynamic fields with ElasticSearch #2334

Closed
wetzf opened this issue Jun 7, 2023 · 2 comments
Closed

Not able to use dynamic fields with ElasticSearch #2334

wetzf opened this issue Jun 7, 2023 · 2 comments

Comments

@wetzf
Copy link
Contributor

wetzf commented Jun 7, 2023

Hello OTOBO Team,

I want to search for dynamic field values via elastic search. To get there, I added a new dynamic field of type 'text' to 'Elasticsearch::TicketSearchFields'. I added the correspondig update event to 'TicketManagement' in the Webservice 'ElasticSearch'.
For newly created tickets I was not able to search for values in this dynamic field.

With the Webservice debugger I found out, that the value is initially set by the event 'TicketCreate' but is immediately reset to 'undef' by the DynamicFieldUpdate event.

TicketCreate:

$VAR1 = {
  'ArticlesExternal' => [],
  'ArticlesInternal' => [],
  'AttachmentsExternal' => [],
  'AttachmentsInternal' => [],
  'Created' => 1686148409,
  'CustomerID' => '123',
  'CustomerUserID' => 'wetzf',
  'DynamicField_Suchtest' => 'orbitaltotal',
  'GroupID' => 1,
  'QueueID' => 4,
  'TicketID' => 6,
  'TicketNumber' => '2023060710000058',
  'Title' => 'Blubber',
  'docapi' => '_doc',
  'id' => 6
}; 

TicketDynamicFieldUpdate_Suchtest:

$VAR1 = {
  'doc' => {
    'CustomerID' => '123',
    'CustomerUserID' => 'wetzf',
    'DynamicField_Suchtest' => undef,
    'GroupID' => 1,
    'QueueID' => 4,
    'TicketID' => 6,
    'Title' => 'Blubber'
  },
  'docapi' => '_update',
  'id' => 6
};

Turns out there is a typo in Kernel/GenericInterface/Invoker/Elasticsearch/TicketManagement.pm. This should be 'DynamicFields', with 's'.
After I changed that, the search worked for me. I will create a pull request for this.

Kind regads

wetzf added a commit to wetzf/otobo that referenced this issue Jun 7, 2023
@svenoe
Copy link
Contributor

svenoe commented Jun 12, 2023

Thanks, pr is merged. :)

@svenoe svenoe closed this as completed Jun 12, 2023
svenoe pushed a commit that referenced this issue Jun 12, 2023
@svenoe
Copy link
Contributor

svenoe commented Jun 12, 2023

Added for rel-10_0; Tidied;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants