Codebarrel - Automation for Jira - Send web request with custom data

Junio Fernandes
Contributor
November 27, 2019

I'm running Jira 7.11.2 with codebarrel Automation for Jira 5.2.8.

I'm trying to send a web request to RocketChat in order to create channels. The RocketChat API require params for this, but Automation for Jira logs:

Error response HTTP body:
{"success":false,"error":"Param \"name\" is required"}

Error publishing webhook. Response HTTP status:
400

Automation configuration:

  • Webhook URL: https://mysecureserver/api/v1/channels.create
  • Headers: X-Auth-Token, X-User-Id and Content-type as application/json
  • HTTP Method: POST
  • Webhook body: Custom data
  • Custom data: {"name":"name_of_channel"}

I've tried with smart value too: {"name":"{{issue.key.toLowerCase()}}"}.

I changed logging configuraton and added "com.codebarrel" package in order to try to see what's happening, but no lucky.

It seems like custom data not forwarded. Any help? Thanks!

1 answer

1 accepted

1 vote
Answer accepted
Junio Fernandes
Contributor
November 27, 2019

After a little breath I found the solution. A mistake, actually.

I had to change the header Content-type to Content-Type and it worked. Obviously!

Vijaya Bhaskar V
Contributor
May 10, 2020

Hi @Junio Fernandes

I am facing the same issue which you have reported here.

Headers: X-Auth-Token, X-User-Id and Content-type as application/json

Do we need to add the credentials here for the authorization ?web-request.PNG

Junio Fernandes
Contributor
May 11, 2020

My problem was about word "type", where it should be "Type" (case sensitive). You did it. So it's not the same problem. I can't say if you need other heads for authorization. Maybe you should start another thread where you explain your use case for a better help. Sorry.

Suggest an answer

Log in or Sign up to answer