Hello,
I've developed a custom field which extends AbstractMultiCFType<String> in a v2 plugin. All is working fine! Now I want to add a searcher, but I don't know how to do that. I found that it is not possible to take SelectSearcher or MultiSelectSearcher (https://developer.atlassian.com/static/javadoc/jira/6.0.3/reference/com/atlassian/jira/issue/customfields/searchers/MultiSelectSearcher.html )
Do you have some code snippet or any ideas ? Thank you!
Community moderators have prevented the ability to post new answers.
You might find the source code in https://bitbucket.org/mdoar/practical-jira-plugins/src/f8c80e3efaa2/multiplevalues/src/main/java/com/mycompany/jira/plugins/multiple/searchers/?at=default useful. This is from one the examples for my O'Reilly book "Practical JIRA Plugins". It was last updated for JIRA 5.2 but the searcher code hasn't changed that much since then IIRC.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oops, now I read the README again (https://bitbucket.org/mdoar/practical-jira-plugins/src/f8c80e3efaa21f80a7e4e3bac55c9c3ba1e40bca/multiplevalues/README?at=default) I see that the searcher was not ported to 5.2, but it did work in 4.4. I don't recall exactly why it didn't get upgraded.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Matt I was following your example from "Practical Jira Plugins", until I got stuck with MultipleValuesCustomFieldSearchInputTransformer and MultipleValuesCustomFieldValidator. Even downloaded the sources, but they don't even compile. Do you have an update? I need to implement a searcher for a custom field[1] but I just don't get to make it (and Atlassian documentation just does not help)
[1]https://answers.atlassian.com/questions/285422/usable-complex-custom-field-searcher-example
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The sources are for JIRA 5.2 as I noted, and haven't been updated for newer versions of JIRA. As you note, the dev docs for JIRA searchers is pretty minimal. All I can suggest is looking at the source of other add-ons in the marketplace that have searchers for guidance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, Matt, for your quick response.
The thing is; I checked the sources and they don't compile:
MultipleValuesCustomFieldSearchInputTransformer and MultipleValuesCustomFieldValidator are missing. Are they part of Atlassian SDK?
This is the error:
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Compilation failure
com/mycompany/jira/plugins/multiple/searchers/MultipleValuesSearcher.java:[81,42] error: cannot find symbol
could not parse error message: symbol: class MultipleValuesCustomFieldSearchInputTransformer
location: class MultipleValuesSearcher
C:\Users\AliedP\Downloads\mdoar-practical-jira-plugins-f8c80e3efaa2\mdoar-practical-jira-plugins-f8c80e3efaa2\multiplevalues\src\main\java\com\mycompany\jira\plugins\multiple\searchers\MultipleValuesSearcher.java:88: error: cannot find symbol
this.customFieldSearcherClauseHandler = new SimpleCustomFieldSearcherClauseHandler(new MultipleValuesCustomFieldValidator(),
^
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am in a similar situation.
I have created a Custom Single Select Field, and now wants to create a Searcher for it.
But I cannot use/extend the SelectSearcher as they are designed for V1 plugins and mine is v2 plugin.
Any directions ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mathias,
MultiGroupCFType, MultiSelectCFType, MultiUserCFType, VersionCFType customfield types extends AbstractMultiCFType cutomfield type.
Therefore depending on your usage , you extend searcher for above mentioned CF.
Look into system-customfieldtypes-plugin.xml in jira source code for more details
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your answer!
In my question I wrote that I use a v2 plugin. In this case it is NOT possible to import "com.atlassian.jira.issue.customfields.searchers.MultiSelectSearcher"...only in v1 plugins.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mathias,
I didnt get the V2 & V1 difference.
Since, you are extending AbstractMultiCFType<String> then you need to write a class similar to com.atlassian.jira.issue.customfields.searchers.MultiSelectSearcher.
And later on extend this class , to have a searcher of your own. again you might have to do some entry in system-customfieldtypes-plugin.xml file (Not sure).
It seems that you might have to do little RnD on it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mathias ,
I dont have code for first step of searcher. i.e. creating class similar to MultiSelectSearcher
And currently , i cant put my effort on it :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mathias,
Please see this link if it can help you : https://bitbucket.org/rbarham/jira-watcher-field-plugin/src/2e5e89b8707e2b59010f5055f52941a54ffaf240/src/main/java/com/burningcode/jira/issue/customfields/searchers/WatcherSearcher.java?at=JIRA-6
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In this source the searcher is extended form
ExactTextSearcher
This will not work with a multi value custom field. Jira can not match a single text with an array.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.