Forums

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

Getting Bugs for a project using REST API

sanisa bhushan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 22, 2018

I want to get all bugs for my project using REST API. Let's say my project id is 15890 and the issuetype for bugs is 1.

How should my query be?

 

I have tried:

 https://jira.domain-name.com/rest/api/2/project/15890/issueType/1 

https://jira.doamin-name.com/rest/api/2/project/15890/search?jql=issueType=Bugs

https://jira.domain-name.com/rest/api/2/project/15890/search?jql=issueType=1

but it gives me status as 404.

 

We also have filters set up for the project as 'Bugs', can I use that too? If yes, then how?

1 answer

1 accepted

1 vote
Answer accepted
Tarun Sapra
Community Champion
August 22, 2018

Hello @sanisa bhushan

Please see examples here

https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/#searching-for-issues-examples

You can use project key and issueType name i.e. Bug in your JQL instead of ids.

Sample 

curl \
   -D- \
   -u charlie:charlie \
   -X GET \
   -H "Content-Type: application/json" \
   'http://localhost:8080/rest/api/2/search?jql=project=QA&type=bug'
Tarun Sapra
Community Champion
August 22, 2018

For clarity you can use the POST call to avoid entering spcl characters in URL in the JQL query while doing get request

https://stackoverflow.com/questions/39974784/jira-rest-api-jql-expression-to-search-by-standard-issue-types

sanisa bhushan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 28, 2018

Thank you. That helped :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events