Forums

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

rest api link issue while creating issue

Ranjith Nair
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!
August 3, 2017

I'm trying to execute CURL command as shown in Jira documents for creating an issue.

I'm using the below command;

curl -D- -u a.b@c.com:myPassword -X POST -data data.txt -H "Content-Type: application/json" http://localhost:8088/rest/api/2/issue/

 

Content of data.txt is as below;

{"fields": {"project":{"key": "CRTQ"},"summary": "Test Summary","description": "This is description","issuetype": {"name": "Bug"}}}

 

Response received;

curl: (3) Port number ended with '\'
HTTP/1.1 400
X-AREQUESTID: 1049x1902x1
X-ASEN: SEN-L10016630
Set-Cookie: JSESSIONID=2599857A6C75D56F1800E2E1F7DB4034;path=/;HttpOnly
X-Seraph-LoginReason: OK
Set-Cookie: atlassian.xsrf.token=BOAQ-4XFZ-EQJV-2T2J|7658a261b648a3a465e0384170dcc1f34c52c016|lin;pa
th=/
X-ASESSIONID: 5wsb8e
X-AUSERNAME: ranjithcnair.in%40gmail.com
Cache-Control: no-cache, no-store, no-transform
X-Content-Type-Options: nosniff
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Thu, 03 Aug 2017 11:59:25 GMT
Connection: close

{"errorMessages":["Unexpected character ('a' (code 97)): expected a valid value (number, String, arr
ay, object, 'true', 'false' or 'null')\n at [Source: org.apache.catalina.connector.CoyoteInputStream
@3af078d7; line: 1, column: 2]"]}

 

 

What am I missing or doing wrong?

1 answer

0 votes
Josh Steckler
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.
August 3, 2017

I think your curl command is malformed, try:

curl -i -u a.b@c.com:myPassword -X POST -d @data.txt -H "Content-Type: application/json" http://localhost:8088/rest/api/2/issue/

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events