Skip to content

Instantly share code, notes, and snippets.

@chester89
Created April 7, 2014 20:52
Show Gist options
  • Save chester89/10050360 to your computer and use it in GitHub Desktop.
Save chester89/10050360 to your computer and use it in GitHub Desktop.
Getting a list of issues from Github closed within date range using Octokit
var credentials = new Credentials(login, password);
var credentialStore = new InMemoryCredentialStore(credentials);
var productHeaderValue = new ProductHeaderValue("MyAmazingApp");
var connection = new Connection(productHeaderValue, credentialStore);
var apiConnection = new ApiConnection(connection);
var issues = new IssuesClient(apiConnection);
var closedSince1Point2 = issues.GetForRepository("ownerLogin", "repoName", new RepositoryIssueRequest()
{
State = ItemState.Closed,
Since = new DateTimeOffset(new DateTime(2011, 4, 3, 14, 0, 0)),
SortDirection = SortDirection.Descending,
SortProperty = IssueSort.Created
}).Result.Where(x => x.ClosedAt < DateTime.SpecifyKind(new DateTime(2012, 6, 20), DateTimeKind.Utc)).OrderBy(x => x.CreatedAt);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment