rest api: where do I find list of searcher classes?

mirek paszkowski November 6, 2017

Searching on a created custom field using jql gives error:

error  "Field 'cf[10024]' is not searchable, it is only sortable."

I understand this to be result of not defining a searcher for the field, so where do I find a list of available searchers?

The field was created with:

"type": "com.atlassian.jira.plugin.system.customfieldtypes:textfield"

 

I have found field type definitions here:

https://bobswift.atlassian.net/wiki/spaces/CSOT/pages/41287807/Custom+Field+Types

By the way, the table is missing :textfield - which I am using for a simple text field, I just need to find the searcher for it.  (I'm guessing the class is  TextSearcher, just need to know how to define it when creating the field)

 

 

 

3 answers

1 vote
mirek paszkowski November 7, 2017

After a bit of guesswork, we have success!

create custom field as below.

 

{
    "name": "test-for-search",
    "description": "Custom field for testing search",
    "type": "com.atlassian.jira.plugin.system.customfieldtypes:textfield",
    "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher"
}

 

0 votes
filipeparedes November 27, 2018

To those that still end up in this page, since Atlassian hasn't yet provided proper documentation or improvements on their API, the best way to figure out the types and searcher keys is by reading the existing ones directly from the jira database:

SELECT DISTINCT [CUSTOMFIELDTYPEKEY],[CUSTOMFIELDSEARCHERKEY]
FROM [jiradb].[jiraschema].[customfield]
WHERE CUSTOMFIELDTYPEKEY LIKE '%customfield%'

0 votes
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 6, 2017

Hello, 

Navigate to the Custom Fields page, locate the desired custom field and choose cog icon > Edit.

You can read more here:

https://confluence.atlassian.com/adminjiraserver071/configuring-a-custom-field-802592532.html

mirek paszkowski November 7, 2017

Unfortunately that does not help as we need to configure as much as possible using the REST API without having a user log in to the JIRA web app.

 

Somewhere on my searches, I found example of creating a custom field, and there is a seacherKey field (here: https://docs.atlassian.com/jira/REST/cloud/?_ga=2.158266362.171452215.1508917703-1204457752.1498574522#api/2/field-createCustomField

 

{
    "name": "New custom field",
    "description": "Custom field for picking groups",
    "type": "com.atlassian.jira.plugin.system.customfieldtypes:grouppicker",
    "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher"
}

- this is what I believe I am missing - and hence asking for the values of type and searcherKey for all supported field types.

 

I have found Javadoc for custom fields and it is possible the value is the name of the class, but all in lower case, so it may be a case of try it and see what happens.

Suggest an answer

Log in or Sign up to answer