Unable to update/remove due dates
bluefroguk1 opened this issue · comments
bluefroguk1 commented
I'm having an issue where i'm unable to update/remove due dates.
I've successfully created tasks and add Due dates. But not able to update or remove due dates from tasks.
import todoist
api = todoist.TodoistAPI('xxxx')
api.reset_state
api.sync()
TaskList = api.state['items']
item = api.items.get_by_id('4061696598')
item.update(due=None)
api.commit
api.sync()
print('done')
I've tried:
due=None
due=null
due=""
due={}
What am i missing?!
Jeremy Foxcroft commented
It looks like you're not committing the change. api.commit
should be api.commit()
; this should get the above code snippet working. item.update(due=None)
is the correct way to remove a due date.
PotHix commented
in this case, item
is just a simple dict
with the item properties.
To change your task you can do the following:
import todoist
api = todoist.TodoistAPI('xxxx')
api.items.update(4061696598, due=None)
api.commit()
I'm closing this one, please reopen if you see any issue.