1

I'm trying to find all PRs across all repos that have a given branch name. I'm using GitHub Enterprise.

SearchIssuesResult contains a List<Issue> Items property. The individual Issues in that list have a Repository property, but it is null, and its sibling property PullRequest doesn't seem to have all the data populated in it.

I therefore want to load the PR directly using the PullRequestsClient.Get method or similar, but this needs a repository ID. I've hit this with a debugger and the Issue results don't seem to contain one anywhere in the hierarchy.

I can infer an owner and name from various URLs that I do have available (e.g. the HtmlUrl property on the Issue) but that seems very hacky and ugly. Is there a better way to do this than relying on URL formats?

Alastair Maw
  • 5,373
  • 1
  • 38
  • 50

0 Answers0