Forums

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

Getting bad request via script, however works with the same parameters via CURL

Neil Quinlan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 12, 2018

Have the below script :

Capture.JPG

That is returning a "Bad Request".

However, I have esentially the same request working via curl.  

curl -D- -H
"Authorization: Basic xxxxxxxxxxxx1bXBraW5zMDQh" -X POST --data
"{ """fields""": { """project""": { """key""": """DWH""" }, """summary""": """REST test 11111.""", """description""": """test""", """issuetype""": { """name""": """Data Requests""" }
,"""components""":[{ """name""":"""Data Warehouse"""}] , """fixVersions""":[{"""name""":"""NA"""}]} }" -H "Content-Type: application/json"
https://jira.xxxxxxxxx.com/rest/api/2/issue/

 

Can anyone see where I am going wrong?


Many thanks!

1 answer

0 votes
MoroSystems Support
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 15, 2018

Hello Neil,

please, is there anything in your log file that could point us in some direction? Otherwise I would try to start low and incrementally enhance your code:

  1. Implement only GET request to check is all the headers are correct.
  2. Change it to POST and send only empty object.
  3. Start enhancing the payload.

Kind Regards,
Martin

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

Atlassian Community Events