Pull Request filter for draft PRs?

Hi, I’m trying to create a search filter for pull requests where I exclude draft PRs. I can’t find any filter option that deals with draft PRs. To show you what I mean I have an example where I exclude PRs with the review:approved status: 

is:pr is:open -review:approved

I would like to hide draft PRs the same way I hide those with approved review status.

47 Likes

Thanks for writing in about this.

We’ll pass this along to our design team. I can’t promise if or when this might be addressed but your feedback is in good hands!

Please let us know if you have any questions about this or anything else.

Thanks,

3 Likes

Hi,

I would like this functionality as well. When draft pull requests were first introcuded, you could filter to show only drafts, but you couldn’t filter them out. Now neither of these are available.

4 Likes

For what it’s worth, i’d like this functionality as well :slight_smile: it would help to sweep across all active PRs faster

Also, if would be very helpful to change an existing PR to “draft”

9 Likes

To exclude draft PR’s you can use -is:draft
is:draft is documented here: https://help.github.com/en/articles/searching-issues-and-pull-requests#search-for-draft-pull-requests

2 Likes

Saddly, that doesn’t work. 

is:open is:pr review-requested:NAME archived:false -is:draft

will change to 

-is:draft is:pr review-requested:NAME archived:false

which will show you all none-draft PRs. Including Closed ones. Not very useful. 

Assumption: Draft is an “issue” state, like Open and Closed. And you can search for only one. 

Try draft:true or draft:false, so you can do is:open draft:false

8 Likes

This worked perfectly, I used 'is:pr is:open review:none draft:false ’
to get a list of all open PR’s excluding drafts that are in need of review.
Thanks!

1 Like

This is awesome!  But *why* does it work? I don’t see this documented anywhere in the advanced search syntax.

This didn’t’ work for me. I’m still seeing drafts mixed into my search results with the following query:

is:open is:pr user:<my_org> draft:false