1

I'm trying to get all the issues (both open and closed sans pull requests) into a .json file from the Jabref repository. So far from other questions, I know that I need to set the status to all and modify the pagination. This is what I have so far:

curl -o issuesAll.json https://api.github.com/repos/JabRef/jabref/issues?per_page=100&state=all

But all that does is give me 100 open issues with pull requests. I tried looking at the Github API v3 documentation, but I just got confused. Is there a way to get all the issues into one file with only one command? Pagination seems to imply that I need to do one call for each page of results (since max number per page is 100)?

dumbitdownjr
  • 185
  • 3
  • 12

1 Answers1

1

You could try instead a GraphQL query, similar to this one

query {
  repository(owner:"octocat", name:"Hello-World") {
    issues(last:20, states:CLOSED) {
      edges {
        node {
          title
          url
          labels(first:5) {
            edges {
              node {
                name
              }
            }
          }
        }
      }
    }
  }
}

Instead of last, you can use "before" (the last field is limited to 100 anyway)

You can use the explorer for testing.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you, but I can't seem to figure out a few things that I want to modify from this example. – dumbitdownjr Aug 06 '19 at 02:00
  • I want to add OPEN to states, but I can't figure out how to have both open and closed states. I also want to iterate through all the issues, and I think I should be able to use the cursor mentioned in the documentation, but I don't see how to check this cursor to see if I am at the end of the issues, or even how to access the cursor (in a for loop?). – dumbitdownjr Aug 06 '19 at 02:06
  • Yeah, I looked at a bunch of tutorials, but I am still confused about how to do this. I guess I will just manually curl 100 issues at a time. – dumbitdownjr Aug 27 '19 at 21:39