0

I am using Octokit to make a report and I need to get the issues of a given repository (which is not hard using the client.Issue.GetAllForRepository method) but then I need the issues' CreatedBy, and ClosedBy when it applies, however it seems both fields are always null. Is there a way to get those without making a hit for every issue.

Note: I'm using Octokit 0.22.0

Here is my issue querying code:

var issues = await client.Issue.GetAllForRepository(organization, repo, new RepositoryIssueRequest
        {
            State = ItemStateFilter.All,
        });
Luiso
  • 4,173
  • 2
  • 37
  • 60

2 Answers2

1

According to the API docs, issues don't return a created_by field: do you mean to just get the user field instead?

As for the missing closed_by block, the default state for returning a list of issues is open, meaning closed issues won't be returned. I'm wondering if this is why all of your closed_by fields are null?

kfb
  • 6,252
  • 6
  • 40
  • 51
  • I am getting all issues, both open and closed, and yet I'm not getting the `closed_by` field. As for the `user` field, I'm not entirely sure what's the difference with 'created_by`, I'd really appreciate if you could point it out. Thank you very much – Luiso Sep 30 '16 at 14:50
  • My understanding is that the `user` field on an issue reflects the user that created the issue—i.e. it is the `created_by` field you're looking for (but that doesn't exist for issues, if the example JSON is anything to go by). – kfb Sep 30 '16 at 14:53
0

If the closed_by field is null, it means the issue is open. The user field is equivalent to created_by.

Aalok
  • 553
  • 8
  • 21