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();
}
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;
}
Aggregations