I'm creating a plugin for Jira 6.4.3 (for a particular client) which stores some data in ActiveObjects tables. Next I wanted to create some custom field types to link some of these values to issues. I've implemented a custom field type which displays the Name property of the object (which I will call Organization for concreteness) but stores the Id property in the database as a string, has a dropdown for editing, and all of this I have working.
Next step is to allow searching on this field, so users can search for issues where Organization = some given value. It's easy to implement a searcher on the id property I'm storing, but I want to index it on the Name property instead. There seems to be little documentation on how precisely one might create one's own custom searcher. I have been attempting to create an implementation of AbstractInitializationCustomFieldSearcher, but I'm having trouble determining what precisely I need to provide my own implementations of. The public properties on the abstract searcher class include a SearcherInformation object, a SearchInputTransformer, a SearchRenderer and a CustomFieldSearcherClauseHandler, and looking in classes like ExactTextSearcher I see other objects like CustomFieldValueProvider and IndexValueConverter which are used to build those objects. So where do I need to inject my ActiveObjects calls to load Organization.Name into the indexing instead of the Id? I'm getting quite lost, but I'd really rather avoid dumping the Organization Name into the database, because I don't want to lose track of issues every time an organization gets renamed.
I found my answer in the Practical Jira Plugins ebook. My custom search was based primarily on ExactTextSearcher, but I created an AbstractCustomFieldIndexer implementation which looked up the Organization's name with ActiveObjects and then added that to the document index.
It wasn't clear to me if this would also work if I merely override getStringFromSingularObject and getSingularObjectFromString and did the ActiveObjects conversion there; it seemed like it should work without requiring any Indexer changes at all, but I couldn't get it to work properly; the Name value kept showing up when I wanted the Id value, because that was now my singular object (transport object?).
I'm developing quite same custom field searcher and also having the same troubles with it. (https://community.atlassian.com/t5/JIRA-questions/Jira-Searcher-for-a-custom-field-add-on/qaq-p/633221#M208743)
Could you, please, show me your implementation?
It's officially Tuesday, which means it's officially time for another tip to help you better navigate this space we call the Atlassian Community. 😄 I got a great question from community member, Sa...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs