Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

jira.add_worklog() fails due to date

feastie
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 19, 2022

Hi All,

I am attempting to add a new worklog using the JIRA python api:

 

jira.add_worklog('MISC-247', timeSpentSeconds='1800', comment='Transfering customer data to one drive in preperation for Thursday', started='2022-04-08T16:45:00.000+0000')

 

I am getting the error:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\ABAdmin\AppData\Local\Programs\Python\Python310\lib\site-packages\jira\client.py", line 129, in wrapper
result = func(*arg_list, **kwargs)
File "C:\Users\ABAdmin\AppData\Local\Programs\Python\Python310\lib\site-packages\jira\client.py", line 2345, in add_worklog
if started.tzinfo is None:
AttributeError: 'str' object has no attribute 'tzinfo'

I vaguely remember a while ago, making chages to client.py to get this to work, but have had my laptop rebuilt and have therefore lost the changes.  Any assistance would be great!!

1 answer

0 votes
Mohamed Benziane
Community Champion
May 31, 2022

The error is not in the script that you're showing so it will be difficult to help you here. 

It seems that you have a variable started(string) and you're asking for the tzinfo attribut which doesn't exist.

Suggest an answer

Log in or Sign up to answer