Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jira curl to get issues

Tags:

curl

jira

I am trying to get data in jira server using curl. I tried this command

    curl -u username:password -X GET -H "Content-Type: application/json" jiraServer/rest/api/2/search?jql=created >= "2015-11-18"

It downloaded a file in the curl directory and the file says

{"errorMessages":["Error in the JQL Query: Expecting operator before the end of the query. The valid operators are '=', '!=', '<', '>', '<=', '>=', '~', '!~', 'IN', 'NOT IN', 'IS' and 'IS NOT'."],"errors":{}}

I tried put the created >= "2015-11-18" in advanced search in Jira web interface and it works. Don't why it failed in curl?

like image 525
thotwielder Avatar asked Oct 15 '25 18:10

thotwielder


1 Answers

You need to encode the URL and enclose in quotes:

curl -u username:password -X GET -H 'Content-Type: application/json' "http://jiraServer/rest/api/2/search?jql=created%20>%3D%202015-11-18"
like image 102
Somaiah Kumbera Avatar answered Oct 17 '25 18:10

Somaiah Kumbera



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!