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!
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!
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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"
}
}'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.