Add different type searchers for customfield

Hi colleagues.
I have multiple type values customfield. It properly searchable by free text searcher but i need to add something like date range search support. Somebody has solved a similar problem?

Can you give us some examples of the values that your custom field will hold, and what you mean by date range search support?

Currently field is searchable by text:
This is one field with multiple values.


I need to make it searchable by Marked date like a date.
Something like
Personal ~ Marked date > 28.05.2017

Unless I’ve misunderstood something, what you want is a custom field of type datepicker, which is “A custom field that stores dates & uses a date picker to view them”. The searcher associated with the datepicker custom field type is Date Range picker.

If you have access to the JIRA Server source code, have a look at the file named system-customfieldtypes-plugin.xml. It gives you all the details of the built-in custom field types. It’s possible to implement your own custom field type, but my advice is to avoid that particular rabbit warren if you can possibly avoid it.

I am already implement my customfield type. Currently it uses freetext searcher. But i need to extend it to use date range searcher date values and freetext for text.

How does the built-in Date Picker custom field type fail to meet your needs?

He completely suits me, I do not know how to connect it in parallel with text search.

OK, I understand. I think you are in for a difficult journey. I’ve never done what you are considering, but I believe you’ll have to implement your own searcher, extending the AbstractInitializationCustomFieldSearcher class. Your searcher will combine the behaviour of the TextSearcher class and the DateRangeSearcher class in the com.atlassian.jira.issue.customfields.searchers package. I would suggest trying to make your class hold instances of those two Atlassian-built classes in member variables, and delegating to them.

All of this pre-supposes that you have access to the JIRA source code, which I’m sure you do.

I have found the custom field type area to be particularly arcane and difficult to work with. My best wishes to you.

1 Like