Search custom date object

Hi,
we use Zammad to deal with external communication with a handful of EMails. Customers can also call us. It is necessary to search these customers by their birthday, since we operate in the medical business. Therefore I’ve created the custom field “birthday” with is a date. However it isn’t possible to find users when inputting a date into the search field. We have Elasticsearch installed and it is running correctly.
I don’t know if I’m making a mistake here, since I’m quite new to Zammad Administration, so I don’t know if this is possible.

Thanks for your help in advance!

  • Used Zammad version: 6.4.1
  • Used Zammad installation type: package

Expected behavior:

  • Searching for a date shows customers with the matching custom “birthday” attribute.

Actual behavior:

  • Searching for a date yields no results

Hi and welcome to the forum,

I did not yet try yet to search based on object attributes, what comes to my mind quickly, is that it is required to rebuild the search index for elasticsearch.

Did you run zammad run rake zammad:searchindex:rebuild after setting up the attribute and inserted data?

Looking at other forum posts, custom attributes should be searchable

Best,
Skip

Yes. The Search Index was already rebuilt.

Other custom attributes are actually searchable. The Date Attribute isn’t, however.

Cheers,
Paul

I created a new user object to store the birthday field, as shown here:
image

After setting this up, I updated the database and restarted Zammad.

Next, I added several birthday dates for customer users:


I then ran the following command to rebuild the search index:
zammad run rake zammad:searchindex:rebuild
image

According to the search documentation here, it’s possible to search by the YYYY-MM-DD format for dates.

When searching for customer.birthday:1980-06-12, I was able to find the tickets associated with that birthday.

Searching in the rails console I was able to find the user by birthday
image

Although @MrGeneration clearly states that Zammad sends everything to Elasticsearch here it is for me not possible to find users by just entering the birthdate

There must be something I am overlooking, the funny thing is, I cannot find the user using the surname either :thinking:. There is probably something wrong with my staging instance since on the production one I can search per surname.

Thanks for your thorough investigation, @skip !

While the Console yields the expected search results, the search with “customer.birthday: YYYY-MM-DD” doesn’t put out users or tickets belonging to the users.

I also suspected errors with Elasticsearch, but it seems to be running fine and even after running the searchindex rebuild again, the error still persists.