Hello everybody. I try to make transition in another instance of Jira and have 500 error in response and also at that time have exception:
org.apache.http.ConnectionClosedException: Premature end of chunk coded message body: closing chunk expected
def http = new HTTPBuilder("${addressJira}/rest/api/2/issue/${fieldValue}/transitions")
try {
http.request(POST, ContentType.JSON) {
requestContentType = ContentType.JSON
request.addHeader("authorization: Basic ${authString}", "ContentType: application/json")
body = ["transition" : ["id": "11"]]
response.success = { resp ->
log.info("Successful " + resp.status.toString())
}
response.failure = { resp ->
HttpResponseDecorator.HeadersDecorator headers = resp.getHeaders()
for (Iterator i = headers.iterator(); i.hasNext();){
def header = i.next()
log.info(header)
}
log.warn("response is : " + resp.getData().toString())
}
}
} catch(Exception e){
log.warn("Eception : " + e)
}
I tried to look at response like that
resp.getEntity().getContent().getText()
and found out that :
java.lang.IllegalArgumentException: Input byte array has incorrect ending byte at 36
Is it means that my request is wrong?
If it interesting to somebody I found out the solution. 500 error was because of apache.
ConnectionClosedException was because of small time out
The IllegalArgumentException problem was because of incorrect auth headers.
def authString = "${user}:${password}".bytes.encodeBase64().toString()
try {
http.request(POST, ContentType.JSON) {
headers.'Authorization' = "Basic ${authString}"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.