REST API GET /rest/api/2/issuetype doesn't return "project" details

Hello,

I’m trying to GET issueType and projects associated with it, however contrary to documentation, where “issuetype” request returns information about the project. I’m not getting this info.

Example from the documentation:

...
{
    "self": "https://your-domain.atlassian.net/rest/api/2/issueType/1",
    "id": "1",
    "description": "A problem with the software.",
    "iconUrl": "https://your-domain.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10316&avatarType=issuetype\",",
    "name": "Bug",
    "subtask": false,
    "avatarId": 10002,
    "entityId": "9d7dd6f7-e8b6-4247-954b-7b2c9b2a5ba2",
    "hierarchyLevel": 0,
    "scope": {
      "type": "PROJECT",
      "project": {
        "id": "10000",
        "key": "KEY",
        "name": "Next Gen Project"
      }
    }
  }
...

I’m not getting anything regarding “scope” and the fields I’m getting are:

  1. “self”
  2. “description”
  3. “iconUrl”
  4. “name”
  5. “subtask”
  6. “avatarId”

I know I can get issueTypes associated to the project using “GET /rest/api/2/project/”, but I want to get projects associated to issueTypes so later I could make a report:

IsueTypeID IssueTypeName NumberOfProjects(count)

How can this information be extracted?

Thanks in advance.

1 Like

@AntanasLeksas,

You posted a question in Jira Server but you linked to documentation for Jira Cloud. These are effectively different code bases with different REST API behaviors. Have you consulted the Jira Server REST API docs? Or are you really having this problem in Jira Cloud?

Hi Ian,

Thanks for the response. This was indeed my mistake, as Cloud API methods were still returning information regarding Server I though this documentation is correct for my version too.

I reviewed the documentation for the server version now and I can see that I’m getting expected data (even when calling REST API v2).

Anyway, I was able to extract the information I needed so far from the previous GET Project response.

1 Like