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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

REST API to get issue types of given project ? Edited

Hi 

 

I am trying the get the issue types using the REST API. I tried the below two APIs. 

 

  1. /rest/api/2/project/{projectIdOrKey}
  2. rest/api/2/issue/createmeta?projectKeys=XXX

 

In both the API result, i am getting 11 issue types. But in actual JIRA UI, I am seeing only 5 issue types.

 

 Is there any REST API available to get only the issue types displayed in the JIRA UI ? Any suggestion on this issue is really appreciated. Thanks in advance.

 

2 answers

0 votes

Hi @Jegan Gopalakrishnan

I wouldn’t  expect either of those calls to return a list of issues

try

/rest/api/2/search?jql=project=“Project Key"

 

https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Query+issues

Hi @tom lister,

Thanks for the quick response. The API that you suggested, gives the list of issues under the project. I am looking for "issuetypes" : list of issuetypes available while creating the JIRA. 

Please let me know if you need any details on the issue. Thanks.

Like agilbert likes this

Hi @Jegan Gopalakrishnan

use

http://localhost:8090/rest/api/2/issue/createmeta?projectKeys=FRO3&expand=projects.issuetypes.fields

you will get the list of issue types available in a project and within the issues a list of fields available and their types  including whether they are mandatory. For select lists the allowed values are shown. This is the most complete information available and is the meta data required fro creating an issue.

Like # people like this

Hi @tom lister

Thanks for getting back to me on this. I tried your API. In that response also, I got required: "true" for all the 11 fields. 

 

"fields": {

"required": true,

...

}

 

Will there be any other reason, why I am unable to see all the 11 fields in the UI ? 

tom lister Community Leader Dec 27, 2018

Hi Jegan

What do you mean by UI? The view screen for issues?

Fields will only be shown if they have values. JIRA doesn't have any custom field value entries for fields until they exist for the specific issue.

My REST data shows a mixture of fields required and not required. I have no reason to believe it's not accurately reflecting the underlying configuration. If you think it's wrong that would be an Altassian support issue.

Hi Tom,

Thanks for helping me out. Will check with support regarding the issue in our Jira server. 

The project API may be an easier way of getting the issue types:

GET /rest/api/2/project/{projectIdOrKey}

This allows you to pass the Project Key and get back most of the metadata about the project including the available issue types

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Software

How to create Jira issus from Excel file?

When to use CSV importer When managing your processes in Jira, there are many occasions where you need to create a lot of tasks. Creating them one by one will cost you a lot of time and effort and i...

4,431 views 22 32
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you