Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Need a list of custom field types

Christian Schulze January 13, 2015

Hello,

I need a list of all available custom field types and searcherKeys.

Via the Rest API there is a mehtod to create a new custom field with this parameters:

{
"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"
}

But there is no List which types or searchKeys are available.

Did somebody know where to find it?

regards 

Chris

 

4 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

3 votes
Christian Schulze March 29, 2016

Hello,

I found a solution a while ago. You can go to this url and get the need information:

http://localhost:2990/jira/rest/api/2/issue/createmeta?projectKeys=DEMO&expand=projects.issuetypes.fields

It works with the Atlassian-plugin-sdk when you use the normal DEMO-Project. 

 

regards

Chris

2 votes
Deleted user March 24, 2016

I had the same question, and just looked up in the JIRA REST API browser, if there is something available. If you have a JIRA 6 installed, the following URL (with the correct server prefix) will give you a JSON object as result:

 

<server-url>/jira/rest/api/2/field

The result in our case was (not complete, just to give an idea):

[
  {"id": "customfield_10190","name": "Reporters Org. Unit","custom": true,"orderable": true,"navigable": true,"searchable": true,"clauseNames": ["cf[10190]","Reporters Org. Unit"],"schema": {"type": "string","custom": "com.atlassian.jira.plugin.system.customfieldtypes:select","customId": 10190}},
  {"id": "timespent","name": "Time Spent","custom": false,"orderable": false,"navigable": true,"searchable": false,"clauseNames": ["timespent"],"schema": {"type": "number","system": "timespent"}},
  {"id": "customfield_11512","name": "Resubmission Date","custom": true,"orderable": true,"navigable": true,"searchable": true,"clauseNames": ["cf[11512]","Resubmission Date"],"schema": {"type": "date","custom": "com.atlassian.jira.plugin.system.customfieldtypes:datepicker","customId": 11512}},
   ...
]

 

So by extracting some information, you have at least which field types are already used in defining custom fields. I am not sure who will get that information, I suspect that you have to be JIRA administrator here.

2 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.
January 13, 2015

You're right, I can't find a list either.  I think part of the problem is that the list is actually variable, not fixed.

There's a load of custom field types that are bundled into a JIRA off-the-shelf, but that's not a definitive list because you can create plugins that add other types.  To compound the problem, searchers are potentially many:many with the field types (e.g. a date range searcher can be used by any date based field, and a date based field could use a date range searcher or an absolute searcher)

when I've needed a rough idea of the types of custom fields in the core, I've tended to just read https://docs.atlassian.com/jira/latest/index.html?com/atlassian/jira/issue/customfields/CustomFieldType.html  - the "all known implementing classes" covers all the types of built in field.

I'd hope someone else has a better answer for you! 

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%'

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.
November 28, 2018

But that assumes that you have added a custom field of each type and you have not got any provided by Apps that do it in odd ways.  Plus you could have different searchers for the same field type.

A far better way is to use the docs given in an earlier answer.

filipeparedes November 28, 2018

True. But you can always manually create the custom fields for the type you want and check it on the DB afterwards.

Anyway, in the end the goal is the same and I can share my field types:

Types

com.atlassian.jira.plugin.system.customfieldtypes:datepicker
com.atlassian.jira.plugin.system.customfieldtypes:datetime
com.atlassian.jira.plugin.system.customfieldtypes:float
com.atlassian.jira.plugin.system.customfieldtypes:importid
com.atlassian.jira.plugin.system.customfieldtypes:labels
com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes
com.atlassian.jira.plugin.system.customfieldtypes:multiselect
com.atlassian.jira.plugin.system.customfieldtypes:multiuserpicker
com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons
com.atlassian.jira.plugin.system.customfieldtypes:select
com.atlassian.jira.plugin.system.customfieldtypes:textarea
com.atlassian.jira.plugin.system.customfieldtypes:textfield
com.atlassian.jira.plugin.system.customfieldtypes:url
com.atlassian.jira.plugin.system.customfieldtypes:userpicker

 

SearcherKeys

com.atlassian.jira.plugin.system.customfieldtypes:daterange
com.atlassian.jira.plugin.system.customfieldtypes:datetimerange
com.atlassian.jira.plugin.system.customfieldtypes:exactnumber
com.atlassian.jira.plugin.system.customfieldtypes:exactnumber
com.atlassian.jira.plugin.system.customfieldtypes:labelsearcher
com.atlassian.jira.plugin.system.customfieldtypes:multiselectsearcher
com.atlassian.jira.plugin.system.customfieldtypes:multiselectsearcher
com.atlassian.jira.plugin.system.customfieldtypes:userpickergroupsearcher
NULL
com.atlassian.jira.plugin.system.customfieldtypes:multiselectsearcher
com.atlassian.jira.plugin.system.customfieldtypes:textsearcher
com.atlassian.jira.plugin.system.customfieldtypes:textsearcher
com.atlassian.jira.plugin.system.customfieldtypes:exacttextsearcher
com.atlassian.jira.plugin.system.customfieldtypes:userpickergroupsearcher

Like # people like this

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events