Search in sources :

Example 1 with IssueRestClient

use of com.atlassian.jira.rest.client.api.IssueRestClient in project tutorials by eugenp.

the class MyJiraClient method createIssue.

private String createIssue(String projectKey, Long issueType, String issueSummary) {
    IssueRestClient issueClient = restClient.getIssueClient();
    IssueInput newIssue = new IssueInputBuilder(projectKey, issueType, issueSummary).build();
    return issueClient.createIssue(newIssue).claim().getKey();
}
Also used : IssueInput(com.atlassian.jira.rest.client.api.domain.input.IssueInput) IssueRestClient(com.atlassian.jira.rest.client.api.IssueRestClient) IssueInputBuilder(com.atlassian.jira.rest.client.api.domain.input.IssueInputBuilder)

Example 2 with IssueRestClient

use of com.atlassian.jira.rest.client.api.IssueRestClient in project syndesis-qe by syndesisio.

the class IssueHooksUtils method analyzeJiraIssues.

public static List<SimpleIssue> analyzeJiraIssues(List<String> jiraIssues, Scenario scenario) {
    List<SimpleIssue> issues = new ArrayList<>();
    JiraRestClient jiraClient = getJiraClient(scenario);
    if (jiraClient == null) {
        return Collections.emptyList();
    }
    IssueRestClient issueClient = jiraClient.getIssueClient();
    for (String tag : jiraIssues) {
        String issueName = tag.replaceFirst("^@", "");
        try {
            com.atlassian.jira.rest.client.api.domain.Issue issue = issueClient.getIssue(issueName).claim();
            issues.add(transformJiraIssue(issue));
        } catch (RestClientException e) {
            log.error("Couldn't obtain the Jira issue : {}", tag);
            scenario.attach("Error while processing Jira issues".getBytes(), "text/plain", "ErrorMessage");
            e.printStackTrace();
        }
    }
    return issues;
}
Also used : SimpleIssue(io.syndesis.qe.issue.SimpleIssue) ArrayList(java.util.ArrayList) JiraRestClient(com.atlassian.jira.rest.client.api.JiraRestClient) RestClientException(com.atlassian.jira.rest.client.api.RestClientException) IssueRestClient(com.atlassian.jira.rest.client.api.IssueRestClient)

Aggregations

IssueRestClient (com.atlassian.jira.rest.client.api.IssueRestClient)2 JiraRestClient (com.atlassian.jira.rest.client.api.JiraRestClient)1 RestClientException (com.atlassian.jira.rest.client.api.RestClientException)1 IssueInput (com.atlassian.jira.rest.client.api.domain.input.IssueInput)1 IssueInputBuilder (com.atlassian.jira.rest.client.api.domain.input.IssueInputBuilder)1 SimpleIssue (io.syndesis.qe.issue.SimpleIssue)1 ArrayList (java.util.ArrayList)1