Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Rest API get all issueTypes without subTasks

Sebastian L. March 1, 2019

Hi Community,

I would like to get a list of IssueTypes except IssueTypes which correspond to the Subtask type. Currently we use

GET /rest/api/2/issuetype

Unfortunately this really delivers all types without filter. In Java there is a function in the REST API I couldn't find anything else.

1 answer

1 accepted

0 votes
Answer accepted
Tarun Sapra
Community Champion
March 1, 2019

Hello @Sebastian L. 

But why do you want a sub-task filter in the issueType REST call when Atlassian provides the info whether the issueType is sub-task or not in the result of the rest call.

GET /rest/api/2/issuetype

 {
"self": "http://localhost:8090/jira/rest/api/2.0/issueType/1",
"id": "1",
"description": "A problem with the software.",
"iconUrl": "http://localhost:8090/jira/images/icons/issuetypes/bug.png",
"name": "Bug",
"subtask": false,
"avatarId": 10002
}

Hence in the above result of the issueType you can see "sub-task" :false and thus you can easily ignore the sub-tasks from the results and store the result in a list of issueTYpes minus the sub-tasks based on the json result.

Sebastian L. March 1, 2019

Thanks @Tarun Sapra 

I thought there was an easier solution than filtering on the client side. 

Suggest an answer

Log in or Sign up to answer