Jira-Python:无法在jira.search_issues中传递用户输入?

时间:2017-07-21 05:55:05

标签: python jira user-input python-jira

我无法将用户输入传递给JQL查询?我没有尝试过替代方案,但没有任何作用。

这是代码。

project_name=raw_input("Please give the project name:  ")
reporter_name=raw_input("Please provide the name of creator:   ")
date_from=raw_input("Please provide the time interval for which you want issues: From ")
date_to=raw_input("Please provide the time interval for which you want issues: To ")"""

total_issues = jira.search_issues('project = %s AND reporter = %s AND created > %s and created < %s' % (projectname, reportername, datefrom, dateto))
print total_issues

它给了我:jira.exceptions.JIRAError

traceback (most recent call last):
  File "jiradetailsizmirtomtom.py", line 27, in <module>
    for i in jira.search_issues('project = project_name AND reporter = reporter_name AND created > date_from and created < date_to'):
  File "/Library/Python/2.7/site-packages/jira/client.py", line 1747, in search_issues
    issues = self._fetch_pages(Issue, 'issues', 'search', startAt, maxResults, search_params)
  File "/Library/Python/2.7/site-packages/jira/client.py", line 397, in _fetch_pages
    resource = self._get_json(request_path, params=page_params, base=base)
  File "/Library/Python/2.7/site-packages/jira/client.py", line 2172, in _get_json
    r = self._session.get(url, params=params)
  File "/Library/Python/2.7/site-packages/jira/resilientsession.py", line 150, in get
    return self.__verb('GET', url, **kwargs)
  File "/Library/Python/2.7/site-packages/jira/resilientsession.py", line 146, in __verb
    raise_on_error(response, verb=verb, **kwargs)
  File "/Library/Python/2.7/site-packages/jira/resilientsession.py", line 56, in raise_on_error
    r.status_code, error, r.url, request=request, response=r, **kwargs)
jira.exceptions.JIRAError

我们真的可以将变量传递给JQL查询吗? JQL是否允许这样做?

0 个答案:

没有答案