1
votes

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)?

1

1 Answers

1
votes

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.