我想用 Java 客户端在 Github 中获取所有问题,以获得确切的里程碑。我试过这个:
public void listClosedIssuesInMilestone(String host, String token, String repository_name, String milestone_name) throws IOException
{
GitHubClient client = new GitHubClient(host);
client.setOAuth2Token(token);
RepositoryService service = new RepositoryService(client);
List<Repository> repositories = service.getRepositories();
MilestoneService milestones = new MilestoneService(client);
for (int z = 0; z < repositories.size(); z++)
{
Repository repository = repositories.get(z);
if (repository.getName().equals(repository_name)) {
List<Milestone> closedMilestones = milestones.getMilestones(repository, "closed");
for (int i = 0; i < closedMilestones.size(); i++)
{
Milestone milestone = closedMilestones.get(i);
if (milestone.getTitle().equals(milestone_name)) {
// TODO get closed issues here
}
}
}
}
}
但我找不到实现这一点的方法。我无法将问题列表纳入里程碑。你能建议我怎么做吗?