所以我正在使用他们的模块与jira合作,试图执行问题转换,有时我会遇到这个错误。当一个队列中有两个以上的问题时,就会发生这种情况(当队列中有一个问题时,效果很好(我的代码是:
def task2(self):
while True:
project.task1(self)
time.sleep(20)
def task1(self):
user = **
pass = **
jira_url = "jira.example.com"
try:
jira_options = ('server': JIRA_URL)
jql_string = jira.search_issue("project = AB")
logging.basicConfig(filename='log-file.log', filemode = '+a', level=DEBUG)
for is_num in jql_string:
issue_num = jira.issue(is_num)
summ = issue.summary
descr = issue.description
//some other code that has nothing to do with jira//
jira.add_comment(issue_num, "Добавить комментарий")
jira.transition_issue(issue_num, "1", fields={'customfield_1':'text1', 'customfield_2':'text2'})
print('well done')
jira.close()
time.sleep(5)
except TypeError as te:
jira.add_comment(issue_num, "Добавить комментарий")
jira.transition_issue(issue_num, "1", fields={'customfield_1':'text1', 'customfield_2':'text2'})
except Exception as exc: #for connection time out
pass
问题出在哪里?它发生在队列中的第二个问题上。没有转换,它可以完美地工作(一些其他代码(
即使只有打印("mth"(,它也不会崩溃,除了Exception,traceback既不记录Error也不记录调试级别的
在调试日志中,只有201和204状态响应
已添加日志。我试着用俄语添加评论,即使出现了错误,它仍然会根据请求添加评论。IDK。。。猜是编码错误。错误:
File "C:scripttask-jira.py", line 231 in add_comm
jira.add_comment(issue, 'xc07 xE0 xFF xE2')
然后是包装器和add_comment中的client.py中的错误。在add_comment 中
r = self._session.post(AttributeError: 'NoneType' object has no attribute 'post'
已对其进行了配置。问题出现在评论文本中。