I'm trying to create an issue in JIRA using the jira-rest-java-client-core API (ver
5.1.2-2bd0a62e).
The error I get back is:
com.atlassian.jira.rest.client.api.RestClientException [ErrorCollection{status=500, errors={}, errorMessages=[Internal server error]}]
I'm at a loss for what to correct, since the error isn't descriptive and implies it's on Atlassian's side.
private String createIssue(TicketRequestMessage message) {
log.info("Sending issue ");
String issueKey = "Empty";
try {
log.info("Get client");
IssueRestClient issueClient = jiraClient.getIssueClient();
IssueInput newIssue = new IssueInputBuilder("DCST", TASK, message.getSummary())
.setDescription(message.getDescription())
.setPriorityId(PRIORITY_MEDIUM)
.build();
log.info("Create issue ");
issueKey = issueClient.createIssue(newIssue).claim().getKey();
} catch (RestClientException e) {
log.error(e.getClass().getName() + " " + e.getMessage());
e.getErrorCollections().stream().forEach(er -> {
er.getErrorMessages().stream().forEach(m -> {
log.error(m);
});
});
}
log.info("Issue key: " + issueKey);
return issueKey;
}
Hi @DJ Spiess ,
Have you tried to create issue via REST API without the "jira-rest-java-client-core API" ?
Have you tried with "Postman" for example, or simply with "okhttp3" or "Unirest" libraries?
Also,
are you using Jira server or cloud?
Where are you trying to run your code from? (from Jira server or external WS)?
No, I the code had worked earlier and I assumed everything underneath was the same. Testing from Postman did help me track down the errors.
We moved to a company wide version of JIRA, and many of the keys had changed underneath me. The password auth didn't work, but an API key did. Fields in the issue were removed, etc. I think the 500 error went away when I used the correct key for a ticket type. After that I started getting 400 type errors with messages I could use. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.