How can I add a searcher to my custom field plugin?

Tobias Rapp December 11, 2019

I have migrated a custom field plugin to Jira 8.5 which is based on CalculatedCFType. As the field contains group names I want to add a searcher (Search Template) based on the GroupPickerSearcher class.

When adding the following lines to atlassian-plugin.xml:

<customfield-searcher key="grouppickersearcher" name="Group Picker Searcher"
i18n-name-key="admin.customfield.searcher.grouppickersearcher.name"
class="com.atlassian.jira.issue.customfields.searchers.GroupPickerSearcher">
<description key="admin.customfield.searcher.grouppickersearcher.desc">Allow to search for a group using a group picker.</description>
<resource type="velocity" name="label" location="templates/plugins/fields/view-searcher/label-searcher-group.vm"/>
<resource type="velocity" name="search" location="templates/plugins/fields/edit-searcher/search-grouppicker.vm"/>
<resource type="velocity" name="view" location="templates/plugins/fields/view-searcher/view-searcher-grouppicker.vm"/>
<valid-customfield-type package="my.jira.plugins" key="my-reportercustomergroups"/>
</customfield-searcher>

this error occurs:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.atlassian.jira.issue.customfields.searchers.GroupPickerSearcher': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.atlassian.jira.issue.customfields.converters.GroupConverter' available: expected single matching bean but found 2: multiGroupConverter,groupConverter

How can I enable usage of the GroupPickerSearcher with my custom field?

2 answers

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 11, 2019

A calculated field might contain any object type as its value.  A GroupPickerSearcher will only be able to work with a group or list of groups as the value of the field.  Does your calculated field return one of those?

Tobias Rapp December 11, 2019

Yes, it does return a Collection<Group>.

0 votes
Alex Christensen
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 11, 2019

I don't know the answer to your question, but just in case you haven't, another good place to post development questions is the Atlassian Developer Community found here:

https://community.developer.atlassian.com/

Couldn't hurt to post in both places!

Tobias Rapp December 11, 2019

Thanks, didn't realize there is an extra community for developers ;)

Suggest an answer

Log in or Sign up to answer