It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Unable to work Custom Field Searcher

Hi, i’m trying to make my own custom field.

IT is work, but i’m trying to make a searcher for them but i’m unnable to do that.

this is my customfield type:

 <customfield-type  name="Prueba" i18n-name-key="" key="admintextfield" class="com.inlogiq.plugins.jira.customfields.JiraCustomField">       
      <description>Solo para administradores</description>      
      <resource type="velocity" name="view" location="/templates/customfields/view.vm"/>
      <resource type="velocity" name="edit" location="/templates/customfields/edit2.vm"/>
      <resource type="velocity" name="xml" location="/templates/customfields/xml.vm"/>         

this is my searcher on the xml:

  <customfield-searcher key="ExactTextSearcherBH" name="Exact Text Searcher BH" class="com.inlogiq.plugins.searcher.SearcherExactText">
    <!-- this element defines the valid custom field types for this searcher --> 
    <valid-customfield-type package="{myPluginKey}" key="admintextfield" />

and this is my class

package com.inlogiq.plugins.searcher;

import com.atlassian.jira.issue.customfields.searchers.ExactTextSearcher;
import com.atlassian.jira.util.JiraComponentFactory;
import com.atlassian.jira.util.JiraComponentLocator;
import com.atlassian.jira.jql.operand.JqlOperandResolver;
import com.atlassian.jira.issue.customfields.searchers.transformer.CustomFieldInputHelper;
import com.atlassian.jira.web.FieldVisibilityManager;

public class SearcherExactText extends ExactTextSearcher {
	public SearcherExactText	(final JqlOperandResolver jqlOperandResolver,final CustomFieldInputHelper customFieldInputHelper,final FieldVisibilityManager fieldVisibilityManager ) {

i found this error on atlassian-jira.log

Exception when retrieving plugin module {myPluginKey}:ExactTextSearcherBH, disabling plugin {myPLuginKey}
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.inlogiq.plugins.searcher.SearcherExactText': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.atlassian.jira.jql.operand.JqlOperandResolver' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}

1 answer

1 accepted

Hi, i found the solution to this.

If you add the import:

`import com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport;`

and then make the constructor like that

public SearcherExactText(@ComponentImport JqlOperandResolver jqlOperandResolver, @ComponentImport CustomFieldInputHelper customFieldInputHelper, @ComponentImport FieldVisibilityManager fieldVisibilityManager) {
super(jqlOperandResolver, customFieldInputHelper, fieldVisibilityManager);

then this will solve the problem

Suggest an answer

Log in or Sign up to answer

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you