JIRA JQL CURL-基于问题名称/描述(基于名称获取故障单ID)REST API进行搜索

时间:2018-02-22 13:08:01

标签: rest curl jira jira-rest-api

我需要根据摘要和说明字段获取Jira票证ID

curl -D- -u user:password -X GET -H "Content-Type: application/json" https://jira.corp.company.com/rest/api/2/search?jql=project="Technology" and summary="Check o365 license"

但获得了curl: (6) Could not resolve host: summary=Check o365 license Unknown error

单独搜索摘要字段时没有错误但没有结果

以下是我用作搜索过滤器(摘要和说明)的票据的一些输出

    "customfield_10600":null,"customfield_10204":null,"customfield_11019":null,"customfield_10205":null,"customfield_10206":null,"attachment":[],"aggregatetimeestimate":0,**"summary":"Check o365 license"**,"creator"
"components":[],"timeoriginalestimate":57600,"description":"Check office 365 license" 

我可以按项目和受让人过滤

jql=project=Technology+AND+assignee=user 

但是当按描述和/或摘要搜索时,现在没有错误但也没有结果:(

1 个答案:

答案 0 :(得分:0)

找到了解决方案:需要使用转义字符

 curl -XH -u user:pass -X GET -H "Content-Type: application/json" https://mycompany/rest/api/2/search?jql=project='"Technology"+AND+summary~"Check%20O365%20License%20"' | python -m json.tool > 1.json