I have a plugin with the following atlassian-plugin.xml
<?xml version="1.0" encoding="UTF-8"?> <atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2"> <plugin-info> <description>${project.description}</description> <version>${project.version}</version> <vendor name="${project.organization.name}" url="${project.organization.url}"/> </plugin-info> <resource type="i18n" name="i18n" location="net.beamartyr.atlassian.issue-cf"/> <customfield-type name="Issue CustomField" i18n-name-key="issue-cf.name" key="issue-cf" class="net.beamartyr.atlassian.jira.customfields.IssueCF"> <description key="issue-cf.description">A custom field that stores a single link to an issue</description> <resource name="view" type="velocity" location="/templates/customfields/issue-cf/view.vm"/> <resource name="edit" type="velocity" location="/templates/customfields/issue-cf/edit.vm"/> </customfield-type> <customfield-searcher name="Issue Searcher" i18n-name-key="issue-cf-searcher.name" key="issue-cf-searcher" class="com.atlassian.jira.issue.customfields.searchers.TextSearcher"> <description key="issue-cf-searcher.description">Search for an issue by id</description> <valid-customfield-type package="${project.groupId}.${project.artifactId}" key="issue-cf"/> <resource type="velocity" name="search" location="templates/plugins/fields/edit-searcher/search-basictext.vm"/> </customfield-searcher> </atlassian-plugin>
The issue type works fine, but when setting it up, I get the message "There are no search templates for this custom field type."
Nothing shows up in the log at default logging levels...
I'm wondering what, if anything, I've defined wrong to use the default built-in text searcher with my custom field?
Community moderators have prevented the ability to post new answers.
This is actually working as expected and the correct answer if you just want to use a system searcher such as ExactTextSearcher or NumberRangeSearcher can be found here: https://answers.atlassian.com/questions/16394860
Still the solution provided here works. But it is not necessary and not recommended when you use a system searcher.
Hi,
if you create own CF and want use searcher for this field, you must create separate searcher class (eg. by extend basic JIRA TextSearcher) in your plugin. I dont known why, but using directly JIRA searcher classes dont work.
Hopes, this help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Example:
<customfield-searcher key="cf-url-searcher" name="URL Link CF Searcher" i18n-name-key="cf.url.searcher.name" class="com.jira.plugin.ea.URLLinkCFSearcher"> <description key="cf.url.searcher.desc">Allows searching for an URL Link by specifying attachment name.</description> <resource type="velocity" name="search" location="/template/plugin/cf/search/urlsearch.vm" /> <resource type="velocity" name="view" location="/template/plugin/cf/search/urlview.vm" /> <valid-customfield-type package="com.jira.plugin.ea" key="cf-url" /> </customfield-searcher>
Plugin searcher class:
import com.atlassian.jira.issue.customfields.searchers.TextSearcher; import com.atlassian.jira.issue.customfields.searchers.transformer.CustomFieldInputHelper; import com.atlassian.jira.jql.operand.JqlOperandResolver; import com.atlassian.jira.web.FieldVisibilityManager; public class URLLinkCFSearcher extends TextSearcher { public URLLinkCFSearcher(FieldVisibilityManager fieldVisibilityManager, JqlOperandResolver jqlOperandResolver, CustomFieldInputHelper customFieldInputHelper) { super(fieldVisibilityManager, jqlOperandResolver, customFieldInputHelper); } }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This helped solve my issue, however in order for it to work, I had to change:
<valid-customfield-type package="com.jira.plugin.ea" ... />
<valid-customfield-type package="${project.groupId}.${project.artifactId}" ... />
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm sorry if this is a dumb question but does the class definition go into the .vm file or do you create a seperate .java file for it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@David Welsh
Thank you for posting this, I have been banging my head against the wall for days trying to get my searcher registered, and adding the proj.groupid and artificate finally made it work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
They should definitely update the documentation at https://developer.atlassian.com/display/JIRADEV/How+to+create+a+new+Custom+Field+Type
because it gives the definite impression you don't need to extend the searcher.
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.