在GHE请求中设置里程碑名称

时间:2019-05-03 09:39:40

标签: java github github-api github-api-v3

我想查询可用的GHE未解决问题。我尝试了这段代码:

RepositoryService service = new RepositoryService(client);
List<Repository> repositories = service.getRepositories();
Repository repository = null;

// Get the repository matching name
for(Repository repo:repositories) {
  if(repo.getName().equals(repository_name)) {
    repository = repo;
    break;
  }
}

List<Issue> issues = new ArrayList<>();
// Get issues in repository
if(repository != null) {
  IssueService issueService = new IssueService(client);
  Map<String,String> filters = new HashMap<>();
  filters.put(IssueService.FILTER_STATE,IssueService.STATE_CLOSED);
  filters.put(IssueService.FILTER_MILESTONE,milestone_name);
  issues = issueService.getIssues(repository,filters);
}

当我发送里程碑名称“ 2019年4月发布”或“ 2019年1月9日发布”时,总是出现错误:

Exception in thread "main" org.eclipse.egit.github.core.client.RequestException: Validation Failed (422): Invalid value of 'Jan 9 2019 release' for 'milestone' field

我需要添加一些转义符吗?

0 个答案:

没有答案