public List<IssueType> getIssueTypes() { try { return Lists.newArrayList(jiraRestClient.getMetadataClient().getIssueTypes().get(timeout, TimeUnit.SECONDS)); } catch (Exception e) { LOGGER.log(WARNING, "jira rest client get issue types error. cause: " + e.getMessage(), e); return Collections.emptyList(); } }
/** * Convenient method to get all issue types of a project. * * @param client The {@link JiraRestClient} * @param projectKey The project key. Is null or empty, all issue types are returned, otherwise issue types for the given projectKey are returned. * @return All issue types or issue types for the given projectKey. * * @throws ExecutionException * @throws InterruptedException */ public static Iterable<? extends IssueType> getIssueTypes(JiraRestClient client, String projectKey) throws ExecutionException, InterruptedException { if (Strings.isNullOrEmpty(projectKey)) { return client.getMetadataClient().getIssueTypes().get(); } final Iterable<CimProject> cimProjects = getIssueMetaData(client, null, (String) null, projectKey); if (cimProjects.iterator().hasNext()) { return cimProjects.iterator().next().getIssueTypes(); } return Lists.newArrayList(); } }
/** * Convenient method to get all issue types of a project. * * @param client The {@link JiraRestClient} * @param projectKey The project key. Is null or empty, all issue types are returned, otherwise issue types for the given projectKey are returned. * @return All issue types or issue types for the given projectKey. * * @throws ExecutionException * @throws InterruptedException */ public static Iterable<? extends IssueType> getIssueTypes(JiraRestClient client, String projectKey) throws ExecutionException, InterruptedException { if (Strings.isNullOrEmpty(projectKey)) { return client.getMetadataClient().getIssueTypes().get(); } final Iterable<CimProject> cimProjects = getIssueMetaData(client, null, (String) null, projectKey); if (cimProjects.iterator().hasNext()) { return cimProjects.iterator().next().getIssueTypes(); } return Lists.newArrayList(); } }