How to get all issues by project key and issue type using REST api

Hi Experts,

Kindly correct my REST api calls. I just want to get all the issues by project key and issue type(filter). I tried but it is not working. please, someone, help me to correct this REST api call.



Have you tried this using the postman collection from the Jira cloud rest API?

1 Like

The JQL you want is probably “project=UC AND issuetype=Test”.
The expand parameter value should probably be “projects,issuetypes,fields”.
Don’t forget to URL-encode your query string parameters.

1 Like

What if the issue type name has space inside ?
For example:
issuetypeName=Test Something


You can try %20 for space in query parameter.

@dchouksey89, doing so is interpreting it as been a next param called “Something” which dosen’t exist oviously.

@Cri . Hello and welcome to the Atlassian Developer Community

Given that there is no such searchable field called ‘issuetypeName’, nobody really cares if it does or doesn’t have a space in it.

I do have a custom issue type name that has spaces. this is why I asked

You are confusing what you have provided as the name for a particular type of issue with a thing you think exists and is called ‘issuetypeName’ that you think contains that piece of data. Jira has no field called ‘issuetypeName’ that contains that data, because the data is stored in the field called ‘issuetype’.

For example, the issue of the type named Story has the name “Story”, just the same as the issue of type named My issue type is named “My issue type”.

If you would have tried doing a JQL search for "“project = “BPT” AND issuetypeName = “My issue type”” Jira would have given you the following message:

Field ‘issuetypeName’ does not exist or you do not have permission to view it.

A simple way to find out what fields exists and can be used as JQL search parameters is to use the Issue Search window, and the drop-down list that appears when you type in the word ‘issue’ will show you all the fields that start with that word:

Annotation 2021-08-16 073910

1 Like

@sunnyape my bad, I meant to refer to “issuetype”.
So this is working for me just fine:


But having an issuetype with spaces dose not:

“errorMessages”: Error in the JQL Query: Expecting either ‘OR’ or ‘AND’ but got ‘Something’

You just have a mal-formed JQL request. If you refer to the Jira JQL documentation and my example shown in the prior post, you’ll see that when you specify a value for a field, and that value contains a space, then you need to enclose the value in quotation marks, like this:

https://server/rest/api/2/search?jql=project = Test AND issuetype = “Test Something”

With URL escape codes for the equals signs, that would be:

https://server/rest/api/2/search?jql=project %3D Test AND issuetype %3D “Test Something”

And if you want to omit the spaces before and after the equals signs, it would be:

https://server/rest/api/2/search?jql=project%3DTest AND issuetype%3D"Test Something"

and, lastly, if you wanted to encode the spaces, it would be:


The easiest way to get familiar with JQL, as a URL, is to go to the Issue Search page in the Jira project, change to Advanced Searching, construct the search you want, click the ‘Switch to JQL’ button, then you will see the full JQL statement, as well as the URL equivalent:

Personally, when I build JQL requests, I always enclose all the text values in double quotes, whether they need them or not, as it is easier to use the same method all the time, not have a different method just for when values have spaces in them.

1 Like

curl -D- -u user:pass -X GET -H “Content-Type: application/json” “https://server/rest/api/2/search?jql=project%3DTest%20AND%20issuetype%3D"Test%20Something"

“errorMessages”: Error in the JQL Query: Expecting either ‘OR’ or ‘AND’ but got ‘Something’

Those two approaches worked for me:

curl -D- -u user:pass -X GET -H “Content-Type: application/json” “https://server/rest/api/2/search?jql=project%3DTest%20AND%20issuetype%3D’Test%20Something’

curl -D- -u user:pass -X GET -H “Content-Type: application/json” -G “https://server/rest/api/2/search” --data-urlencode “jql=project=Test AND issuetype=‘Test Something’”

The reason that first request didn’t work was because you haven’t escaped the double quotation marks within curl’s URL declaration by using backslashes.

Do a Google search for “curl url escape double quotation marks” for the many hundreds of articles that describe that.