https://developer.github.com/v3/pulls/#list-pull-requests mentions that state can be open, closed or all, however, there is no merged state.
How can I list merged pull requests only?
Solved! Solved! Go to Solution.
The search API can search "merged pull requests" with "is:merged" operator.
I hope this helps!
Yes, this is helpful, thanks.
I've been looking into it and am almost done with what I want to do. Unfortunately, I can't find any information on how to sort by merged-asc / merged-desc via the Search API.
This is possible in the web version of GitHub.
I've read the documentation at https://help.github.com/articles/sorting-search-results/ and https://help.github.com/articles/sorting-issues-and-pull-requests/ but it has no documentation on the aforementioned sorting on the Search API
The query I currently have is
Edit1: &sort=merged doesn't do anything, I wrongly assumed so.
And I want to sort by the opposite order, just like it's possible to do in the web version, as in is:pr is:merged sort:merged-asc merged:>2018-10-01
How can I apply such sorting via the Search API?
I'm glad that helped! You can include the sort qualifier
+sort:author-date-desc for descending and
+sort:author-date-asc for ascending.
Unfortunately this tag doesn't sort by merged order.
In fact, after taking a closer look, I noticed merge / closed sort it's likely not implemented. sort:merge or sort:closed doesn't do the intended sort on the web interface and on the search API it's doing nothing (the default sorting by creation date is applied).
For example, a small sample with (currently) 6 PRs
I already tried sort = merged, merged-asc, merged-desc, closed, closed-asc, closed-desc, none seem to make any effect.
Would it be possible to implement sorting by closed/merged date?
What do you see when:
I get the same output as I would get with
I thought &sort=merged did anything because on the web interface adding it ("sort: merged-asc") actually returns a different order than the default one even though it's also not the correct one.
I now realized that merge/closed datetime related sorting options are not implemented, because trying any sort that is not implemented (e.g. "sort: asdfgh") will return the same output as trying "sort: merged-asc".
What does work differently is
which shows the PRs ordered by the last update order.
However, this is not the effect I'm looking for, as a comment in a PR will change the last update date. I need to order by the "closed_at" parameter (close/merge datetime).
Hmmm, I see what you are saying, there is a limitation the only sort orders we can use are the ones in the drop down below, I can definitely see how helpful it would be to have that option and I'm passing this feedback as a feature request.