jira curl 获取问题

jira curl to get issues

我正在尝试使用 curl 在 jira 服务器中获取数据。我试过这个命令

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

它在 curl 目录中下载了一个文件,文件内容为

{"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":{}}

我尝试将创建的 >= "2015-11-18" 放入 Jira Web 界面的高级搜索中,它起作用了。不知道为什么它在 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"