@Override public String apply(IdentifiableEntity<String> entity) { return entity.getId(); } };
@Override public String apply(NamedEntity entity) { return entity.getName(); } };
public RestClientException(final RestClientException exception) { super(exception.getMessage(), exception); this.statusCode = exception.getStatusCode(); this.errorCollections = exception.errorCollections; }
/** * Does the same as {@link #getIssueMetaData(JiraRestClient, String, String, String)} but filters by issueTypeId instead of issueTypeName. * * @see #getIssueMetaData(JiraRestClient, String, String, String) */ public static List<CimProject> getIssueMetaData(JiraRestClient client, String expandos, Long issueTypeId, String projectKey) throws ExecutionException, InterruptedException { return Lists.newArrayList(client.getIssueClient().getCreateIssueMetadata( new GetCreateIssueMetadataOptions( expandos == null ? null : Lists.newArrayList(expandos), null, // no issue type names issueTypeId == null ? null : Lists.newArrayList(issueTypeId), projectKey == null ? null : Lists.newArrayList(projectKey), null)) // no project ids .get()); }
private com.atlassian.jira.rest.client.api.domain.Issue getIssue(String trackerId) throws NotFoundException { try { return restClient.getIssueClient().getIssue(trackerId).get(); } catch (Exception e) { throw new NotFoundException(e); } }
private static void validateProjectKey(JiraRestClient client, String projectKey) { System.out.println("Validating project with key '" + projectKey + "'..."); try { if (client.getProjectClient().getProject(projectKey).get() == null) { throw new RuntimeException("Project with key = '" + projectKey + "' does not exist"); } } catch (InterruptedException | ExecutionException e) { throw new RuntimeException("Could not retrieve project data for project with key '" + projectKey + "' from jira", e); } System.out.println("OK"); }
public GetCreateIssueMetadataOptions build() { return new GetCreateIssueMetadataOptions(expandos, issueTypeNames, issueTypeIds, projectKeys, projectIds); } }
@Override public void destroy() { try { restClient.close(); } catch (IOException e) { LOG.warn("destroyin jira issue tracker", e); } }
@Override public void apply(final Request request) { authenticationHandler.configure(request); } });
/** * Get User's permissions * */ public Permissions getMyPermissions() throws RestClientException { return jiraRestClient.getMyPermissionsRestClient().getMyPermissions(null).claim(); } }
@Override public T claim() { try { return delegate.claim(); } catch (RestClientException e) { throw new RestClientException(e); } }
/** * Does the same as {@link #getIssueMetaData(JiraRestClient, String, String, String)} but filters by issueTypeId instead of issueTypeName. * * @see #getIssueMetaData(JiraRestClient, String, String, String) */ public static List<CimProject> getIssueMetaData(JiraRestClient client, String expandos, Long issueTypeId, String projectKey) throws ExecutionException, InterruptedException { return Lists.newArrayList(client.getIssueClient().getCreateIssueMetadata( new GetCreateIssueMetadataOptions( expandos == null ? null : Lists.newArrayList(expandos), null, // no issue type names issueTypeId == null ? null : Lists.newArrayList(issueTypeId), projectKey == null ? null : Lists.newArrayList(projectKey), null)) // no project ids .get()); }
public RestClientException(final RestClientException exception) { super(exception.getMessage(), exception); this.statusCode = exception.getStatusCode(); this.errorCollections = exception.errorCollections; }
@Override public String apply(IdentifiableEntity<String> entity) { return entity.getId(); } };
public GetCreateIssueMetadataOptions build() { return new GetCreateIssueMetadataOptions(expandos, issueTypeNames, issueTypeIds, projectKeys, projectIds); } }
@Override public String apply(NamedEntity entity) { return entity.getName(); } };
@Override public Object execute() throws Exception { JiraRestClient jiraClient = createJiraClient(); try { doExecute(jiraClient); } finally { jiraClient.close(); } return null; }
@Override public boolean apply(T input) { return id.equals(input.getId()); } }