Hey Folks!
I'm trying to set up my own integration between Jira and Slack using the endpoint scriptrunner feature.
In Jira I made a listener spritrunner for the approval process. When the assignee changed I send several requests:
Both jsons are working fine.
The problem occurs when the button is clicked and the request goes to the spritrunner endpoint and I cannot read the contents of the payload inside the endpoint. the body comes empty. I tried sending requests from the postman, and the body arrived correctly.
Custom endpoint is simple, it looks like:
import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate
import groovy.json.JsonBuilder
import groovy.transform.BaseScript
import org.codehaus.jackson.map.ObjectMapper
import javax.ws.rs.core.MultivaluedMap
import javax.ws.rs.core.Response
import groovyx.net.http.ContentType
import javax.servlet.http.HttpServletRequest
import groovy.json.JsonSlurper
import groovy.json.JsonOutput
@BaseScript CustomEndpointDelegate delegate
doSomething(httpMethod: "POST"){ MultivaluedMap queryParams, String body ->
JsonOutput.toJson([data: body])
log.info("Success! ${body}")
return Response.ok(new JsonBuilder([abc: 42]).toString()).build();
}
Perhaps is required to specify a special content type format application/x-www-form-urlencoded in the endpoint to read information from slack, but I don’t know how to do it correctly.
Hope yoг help.
It was indeed a known issue, but it's been resolved now. :)
I think this is a known issue in onDemand, with IE8. Don't remember the issue key.
People were able to try again and it went through. Other browsers were working fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Trouble is, it's a client and they can only use IE8. Will investigate the known issue. 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.