Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the type of field (be it system field or custom field) using Jira REST API?

Keerthana Bhuthala
Contributor
December 13, 2020

Hi Team,

I would like to get the "field type" of a field using Jira REST API. I am trying to create/update the issues in Jira using the REST API and while am creating/updating the issues, the syntax varies depends on the type of field, for example, it varies for multi-select list field, cascading select list field, select list field or text field.

So, I would like to know the type of the particular field using REST API before even creating/updating the issue so that I can use the correct syntax accordingly. I could not find any relevant article on this. Could you please let me know if this is possible?

Thank you!
Keerthana Bhuthala.

2 answers

0 votes
Prince Nyeche
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.
December 13, 2020

Hi @Keerthana Bhuthala 

Welcome to community! In order to know the Field type prior to creation, you will need to search the Custom Field endpoint. you can create a function to return a field type prior to creation. From the output JSON it will return the type and searcherKey, which you can use to determine what type of field you need.

0 votes
Nic Brough -Adaptavist-
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.
December 13, 2020

The call that asks Jira what data the create issue will ask contains the broad description of the data it expects and the name of the class that provides the field.

See https://developer.atlassian.com/server/jira/platform/jira-rest-api-example-discovering-meta-data-for-creating-issues-6291669/

Suggest an answer

Log in or Sign up to answer