简体   繁体   中英

jira curl to get issues

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?

您需要对URL进行编码并用引号引起来:

curl -u username:password -X GET -H 'Content-Type: application/json' "http://jiraServer/rest/api/2/search?jql=created%20>%3D%202015-11-18"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM