Forums

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

Sending data in webhook payload

Hudson Billock August 4, 2022

I am trying to set up a Jira automation chain that takes data from a webhook payload and creates a new issue with the specified information using smartvalues. This process is outline in the Jira automation section, but the given code doesn't seem to work. I can get the webhook to trigger the automation rule with the given curl command:

curl -X POST -H 'Content-type: application/json' \
https://automation.atlassian.com/pro/hooks/specific_id

However, it fails to post when I execute this command that is given to include additional data:

curl -X POST -H 'Content-type: application/json' \ 
--data '{'{"data": {"myData":"test"}}'}' \
https://automation.atlassian.com/pro/hooks/specific_id

I get the following error:

{"message": "Unsupported Media Type"}

This makes me suspect there is something wrong with how I am sending the data. Has anyone had this problem or could help me out? Thanks! 

1 answer

1 accepted

3 votes
Answer accepted
Eugenio Onofre
Community Champion
August 4, 2022

Hello @Hudson Billock
Welcome to the Atlassian Community!

Would you please post your entire JSON with the Smart Values, if possible?

That would help to better investigate your issue.

Thanks!

Hudson Billock August 4, 2022

I just wanted to send the one for now (myData) to test it out. I don't have any more code right now (as you can probably tell, I'm fairly new to this). However, the example on the automation page said that something like this would work. 

Eugenio Onofre
Community Champion
August 4, 2022

Seems like your json is malformed.

Please try the below one:

curl --location --request POST 'https://automation.atlassian.com/pro/hooks/specific_id' \
--header 'Content-Type: application/json' \
--data-raw '
{
"data": {
"myData":"test"
}
}'
Hudson Billock August 4, 2022

That didn't quite work, but I running this: 

curl -v  -X POST -H 'Content-type: application/json' \

--data-raw '{"data": {"myData":"test"}}' \

https://automation.atlassian.com/pro/hooks/specific_id 

 Seemed to do the trick, it seems like it was the --data-raw tag that did it. Thank you for your help!

Like Eugenio Onofre likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events