Abubakkar Rangara Abubakkar Rangara - 6 months ago 66
Java Question

Reading Jira Webhook POST data

I am trying to read Jira issue data using a webhook that posts the data to my servlet.

When I travserve the request parameters map, I don't find anything in it.

But the content lenght shows as "8876" which means webhook is sending the data. Somehow I am not able to read/retrieve the data in my servlet.

Also checked, content-type returns as "application/json".

Does anyone know how to read Jira webhook post data?

Answer

You have to read the response body, not the parameters map. For that purpose you can use

 request.getInputStream();

or

request.getReader();

method.

PS: You can configure the web hook to post data to http://requestb.in/ so you can easily analyze the request parameters, the request body, the headers, etc.