Luiso
Luiso

Reputation: 4113

Get issues CreatedBy user using Octokit

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,
        });

Upvotes: 0

Views: 434

Answers (2)

Aalok
Aalok

Reputation: 583

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

Upvotes: 0

kfb
kfb

Reputation: 6532

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?

Upvotes: 1

Related Questions