Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.

Register Now
AUG Leaders

Upcoming Jira Events