我想通过日期范围查询问题,例如:
created >= 2016-04-03 and created <= 2016-04-30
如何使用Get或Post实现此目的?
得到这样的:
rest/api/2/search?jql=project=test &created...
像这样发布:
{'jql':'project = test','startAt':0,'maxResults':10,...}
感谢所有回答问题的人。 要解决这个问题需要注意以下几点:
String jql = "assignee = youwei.yao AND status = CLOSED AND created > = 2016-04-03 AND created < = 2016-04-03 order by created";
jql = URLEncoder. Encode (jql, "utf-8");
String url = "http://host:port/rest/api/2/search?jql=" + jql;
然后通过HttpClient使用此URL提交您的请求
对于GET:
我认为你所缺少的是把+
放在空间里。例如。 +and+
。这适用于GET请求。
/rest/api/2/search?jql%3Dproject%3Dtest%2Band%2Bcreated%3E%3D2016-04-03%2Band%2Bcreated%3C%3D2016-04-30
有关如何在latest JIRA REST documentation中为GET和POST请求执行此操作的文档