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

How to retrieve all unique/distinct issueTypes from a project using JQL Search via REST

Lloyd Roles
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 11, 2012

Hi guys,

Looking at the Jira 5.0 REST API I am unable to see a call that will give me all issueTypes from a given project.

Then I thought that I might be able to use the JQL search REST call to accomplish this:

/rest/api/latest/search?jql=project='MyProject'%20ORDER%20BY%20issueKey&fields=key,issuetype
The JQL is really simple:   project='MyProject' ORDER BY issueKey

However, this is giving me a list of every issue in the project. I will then have to do some processing on the results to find the unique issue types which is quite inefficient.

Is there some kind of unique/distinct modifier I can provide in the JQL to return only a list of issue types from a single project?


2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Lloyd Roles
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 16, 2012

I could not find a way to filter issueType based on the project.

In the end, I just used the following REST resource:

/rest/api/2/issuetype


1 vote
C_ Faysal
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 11, 2012

doesn't ORDER BY needs ASC or DESC?

try this line

/rest/api/latest/search?jql=project=<YourProject> ORDER BY issuekey ASC

C_ Faysal
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 11, 2012
Ah ok sorry then. But anyway i successfully recieved a valid result
Lloyd Roles
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 11, 2012

No, I don't believe ORDER BY needs ASC/DESC. By default, the field's own sorting order will be used. https://confluence.atlassian.com/display/JIRA051/Advanced+Searching#AdvancedSearching-ORDERBY

C_ Faysal
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 11, 2012

oh i see..sorry for misunderstanding

Lloyd Roles
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 11, 2012

Yeah, but it doesn't answer the original question. The closest I have come is to get a list of issueTypes accessible to the current user using:

/rest/api/2/issuetype

However, it doesn't look like this can be filtered on a per-project basis :(

TAGS
AUG Leaders

Atlassian Community Events