So I'm working with jira using their module, trying to execute issue transitions and sometimes I get this error. It happens when there are more than 2 issues in a queue (and works fine when there is one in queue) My code is:
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
What can be the problem? It happens on second issue in a queue. Without transitions it works perfectly (some other code)
And it's not crashing even when there is only print('smth') in except Exception, traceback not logging neither with Error nor debug level
In debug log only 201 and 204 status responses
Added log. I'm trying to add comments in russian, and even though the error - it still adds commentary to request. IDK... Guess some encoding error. Error:
File "C:\script\task-jira.py", line 231 in add_comm
jira.add_comment(issue, 'xc07 xE0 xFF xE2')
Then errors in client.py in wrapper and add_comment. In add_comment
r = self._session.post(AttributeError: 'NoneType' object has no attribute 'post'