How to know the Jira version before calling createmeta api to get the issue types

  1. Our app is a public app that supports both cloud and on premise account.
  2. We make use of createmeta api to get the issuetypes. Since this method is deprecated / removed in data center versions 9 and above, we are facing issue in supporting both cloud and on premise accounts at once. And also there is a possibility that on premise account are still having the old Jira data center versions too.
  3. Is there an api to get the data center version even before making the createmeta api call.

I’ll appreciate it if someone can help.

Thanks.

https://docs.atlassian.com/software/jira/docs/api/REST/8.14.1/#api/2/serverInfo

{
    "baseUrl": "http://localhost:8080/jira",
    "version": "5.0-SNAPSHOT",
    "versionNumbers": [
        5,
        0,
        0
    ],
    "buildNumber": 581,
    "buildDate": "2021-01-14T20:13:02.991+0000",
    "serverTime": "2021-01-14T20:13:02.991+0000",
    "scmInfo": "1f51473f5c7b75c1a69a0090f4832cdc5053702a",
    "buildPartnerName": "Example Partner Co.",
    "serverTitle": "My Shiny New Jira Server"
}

Hi @soumitra,

Thanks @KCWong for that reply. Also, according to the documentation in Jira 9.2.0 createmeta as a GET request is still available. I’ve just tested and I’ve got data in my local instance

$ curl --silent --user admin:admin --request GET --url 'http://localhost:2990/jira/rest/api/2/issue/createmeta/PROJ/issuetypes'
{
  "maxResults": 50,
  "startAt": 0,
  "total": 5,
  "isLast": true,
  "values": [
    {
      "self": "http://localhost:2990/jira/rest/api/2/issuetype/10000",
      "id": "10000",
      "description": "Created by Jira Software - do not edit or delete. Issue type for a big user story that needs to be broken down.",
      "iconUrl": "http://localhost:2990/jira/images/icons/issuetypes/epic.svg",
      "name": "Epic",
      "subtask": false
    },
...

Regards,
James.

Hello @jrichards

Thanks for the reply , I have also got data for my local instance using ‘http://localhost:8080/rest/api/2/issue/createmeta/10000/issuetypes/’ but for cloud account using the same createmeta api call example->‘https://mysamurai.atlassian.net/rest/api/2/issue/createmeta/10017/issuetypes/’ → I am getting response as 404.

My doubt is, if createmeta is working well with local instances then why is it failing for cloud accounts?

Thanks.

I got the same problem.

Get create issue meta DEPRECATEDGET /rest/api/2/issue/createmeta

The deprecated API returns 200 and successfully gave me my list of projects and associated issue types.

Get create issue meta project issue typesGET /rest/api/2/issue/createmeta/{projectIdOrKey}/issuetypes

This gave me 404.

Thanks for the confirmation @KCWong . Have you found any solutions for this issue?

In Jira Cloud there is old version GET /rest/api/2/issue/createmeta
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-createmeta-get that can be called with expand=projects.issuetypes.fields.

Since Jira 9.x Server/DC the old GET /rest/api/2/issue/createmeta is replaces by 2 separate methods:
GET /rest/api/2/issue/createmeta/{projectIdOrKey}/issuetypes
GET /rest/api/2/issue/createmeta/{projectIdOrKey}/issuetypes/{issueTypeId}

Hope that helps.