I am trying to implement a simple Test Searcher for my custom field but it does not work.
Here is a part of atlassian-plugin.xml.
<customfield-type name="My Custom Field" i18n-name-key="my-custom-field.name" key="my-custom-field"
class="com.example.jira.customfields.MyCustomField">
<description key="my-custom-field.description">The My Custom Field Plugin</description>
<resource name="view" type="velocity" location="/templates/customfields/my-custom-field/view.vm"/>
<resource name="edit" type="velocity" location="/templates/customfields/my-custom-field/edit.vm"/>
</customfield-type>
<customfield-searcher name="Text Searcher" i18n-name-key="text-searcher.name" key="text-searcher"
class="com.atlassian.jira.issue.customfields.searchers.TextSearcher">
<description key="text-searcher.description">The Text Searcher Plugin</description>
<valid-customfield-type package="com.example" key="my-custom-field"/>
<resource name="search" type="velocity" location="/templates/customfields/text-searcher/search.vm"/>
</customfield-searcher>
This is MyCustomField.java
package com.example.jira.customfields;
import com.atlassian.jira.issue.customfields.impl.GenericTextCFType;
import com.atlassian.jira.issue.customfields.manager.GenericConfigManager;
import com.atlassian.jira.issue.customfields.persistence.CustomFieldValuePersister;
import com.atlassian.jira.issue.customfields.persistence.PersistenceFieldType;
import com.atlassian.jira.issue.fields.TextFieldCharacterLengthValidator;
import com.atlassian.jira.security.JiraAuthenticationContext;
import com.atlassian.plugin.spring.scanner.annotation.imports.JiraImport;
public class MyCustomField extends GenericTextCFType {
public MyCustomField(@JiraImport CustomFieldValuePersister customFieldValuePersister, @JiraImport GenericConfigManager genericConfigManager, @JiraImport TextFieldCharacterLengthValidator textFieldCharacterLengthValidator, @JiraImport JiraAuthenticationContext jiraAuthenticationContext) {
super(customFieldValuePersister, genericConfigManager, textFieldCharacterLengthValidator, jiraAuthenticationContext);
}
@Override
protected PersistenceFieldType getDatabaseType() {
return PersistenceFieldType.TYPE_UNLIMITED_TEXT;
}
}
After uploading the plugin, it shows a ‘no search temple’ message.