in src/main/java/com/googlesource/gerrit/plugins/its/jira/JiraClient.java [60:77]
public boolean issueExists(JiraItsServerInfo server, String issueKey) throws IOException {
JiraRestApi<JiraIssue> api = apiBuilder.getIssue(server);
api.doGet(issueKey, HTTP_OK, new int[] {HTTP_NOT_FOUND, HTTP_FORBIDDEN});
Integer code = api.getResponseCode();
switch (code) {
case HTTP_OK:
return true;
case HTTP_NOT_FOUND:
log.error("Issue {} not found", issueKey);
return false;
case HTTP_FORBIDDEN:
log.error("No permission to read Issue {}", issueKey);
return false;
default:
// Cannot happen due to passCodes filter
throw new IOException("Unexpected HTTP code received:" + code.toString());
}
}