Forums

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

How to filter Defects in Issues Rest API

Dean Jones July 18, 2022

I have a requirement where I need to filter defects and bugs from the issues , currently i am using https://XXXXXXX/rest/api/2/search?jql=project=Proj1&ORDER%20BY%20Created 

this returns me all the issues - when I try to filter the defects in issues it return me all the issues and not the defects (or bugs) which I have added in the filter . when I try it from the Jira portal I am able to filter them using the issue-type in (Defect,Bug).

1 answer

1 accepted

1 vote
Answer accepted
Walter Buggenhout
Community Champion
July 19, 2022

Hi @Dean Jones,

The search parameter in your url ("?jql=...") indeed literally returns all issues from Proj1. You should update that parameter with the part that you mention. To get the exact syntax, you should include the AND issuetype in (Defect, Bug) part as well.

If you execute the search in Jira, look at the url in your browser. It will help you construct the right syntax pretty easily.

Hope this helps!

Dean Jones July 22, 2022

Thank you @Walter Buggenhout it worked like a charm!!!!

Like Walter Buggenhout likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events