The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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
Community Champion
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.