Does JIRA On Premise support expanding issueTypes in 'project' api endpoint?

Usersnap Developer
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 16, 2018

It looks like the JIRA Cloud API is different from JIRA On Premise, why is that and will it be fixed/updated in the future?

It specifically happens in the `/rest/api/2/project?expand=issueTypes` endpoint which works perfectly for JIRA Cloud but doesn't work on JIRA On Premise.

 

3 answers

1 vote
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 26, 2018

Jira Cloud does allow for you to expand issueTypes in this rest call.  When you make this rest call you can see in the first lines of the response what options can be expanded:

[
  {
   "expand":"description,lead,issueTypes,url,projectKeys",

In this case, you can expand description,lead,issueTypes,url, or projectKeys.   This expand options are clearly documented in that REST documentation for Cloud: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-project-get

However when you make this same rest call in Jira Server 7.9.1, the expand options are slightly different:

[
  {
    "expand": "description,lead,url,projectKeys",

issueTypes is not listed a option to expand in Server for that specific call.   Our REST documentation for server just states that you can expand parameters, it does not currently specify which parameters can be expanded in that call.

 

Why is it that Cloud can do this and Server cannot?  Well, Jira Server and Jira Cloud are technically different products.  As such there are some features and functions that exist in one, but not the other and vice versa.   I believe you have found one of these specific features that does not currently exist in Jira Server.   I went back to look and see if this specific feature has existed in Jira Server in the past, and from what I could determine this has not been a feature in the Server line before.  It appears that this is a new feature that Jira Cloud introduced first, and in turn Jira Server has never implemented this new feature.   I don't know if there was a specific reason for that or not yet.  Not all changes to one product will find their way into the other product.

But I agree that this would be useful to have in Server as well.  So to help facilitate that possibility, I went ahead and created a feature request for this in https://jira.atlassian.com/browse/JRASERVER-67216

I agree that it would be nice to have this in Server, both from an ease of use and from a consistency standpoint between the two products.  However at this time, I can not guarantee this feature will be implemented in Jira Server.

In the meantime, @miikhy's suggestion of using the GET /rest/api/2/project/{projectIdOrKey} endpoint can still provide you with the issueTypes from that specified project.  I understand this is not an ideal work-around as this only applies to the project queried and not all projects as is possible on the Cloud REST API.  Alternatively, you can also call the GET /rest/api/2/issuetype endpoint to find all issuetypes, but this has a different limitation as it does not indicate which issue types belong to which projects. 

I hope this helps.

Andy

Boris Berenberg - Atlas Authority
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.
April 26, 2018

Mostly agree with you Andy but a point of contention is the Schema which is provided with the request. It clearly shows an expanded list of IssueTypes in it. I believe that this caused confusion for both the Usersnap team and myself.

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 27, 2018

@Boris Berenberg - Atlas Authority Thanks for bringing up this point as well.  I was focused on the cloud vs server and the expand aspects of this because I thought it more closely addressing the original question. 

But I think you raise a good related point here as well.   I did some more searching on this and came across this existing feature request to update the documentation on this schema as it is incorrect.  Please see https://jira.atlassian.com/browse/JRASERVER-65976 for more details.   In my view this should not be a feature request, but instead a documentation bug, so I have converted this issue as such.

Thanks

0 votes
Boris Berenberg - Atlas Authority
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.
April 24, 2018

What version of Jira OnPrem? https://docs.atlassian.com/software/jira/docs/api/REST/7.9.1/#api/2/project-getProject specifies that this should work.

miikhy
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.
April 24, 2018

It seems that the question was to get this for /project (all projects) not a specific project in my understading. If not, as we both mentioned, it's available for quite a while, without the expand needed!

Cheers

Boris Berenberg - Atlas Authority
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.
April 24, 2018
Boris Berenberg - Atlas Authority
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.
April 24, 2018

nvm, I see what I overlooked. You're right, there seems to not be a working handler for that expand value. The schema in the API docs is wrong.

0 votes
miikhy
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.
April 24, 2018

Hi!

I can't answer your question, will ping Atlassian though!

That being said, on Jira Server, if you're pinging a specific project through /rest/api/2/project/{projectKey or Id}, issueTypes are returned, that can be a workaround while getting more feedback from Atlassian!

Cheers

Suggest an answer

Log in or Sign up to answer