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.
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you want it for all projects then you would use: https://docs.atlassian.com/software/jira/docs/api/REST/7.9.1/#api/2/issuetype-getIssueAllTypes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.