todoist_interface/todoist_interface/utils.py

16 lines
562 B
Python
Raw Normal View History

2021-11-06 20:07:57 +01:00
def get_missing_tasks(tasks, issues_to_check):
"""
Check if tasks exists in tasks_to_check
:param tasks: list of tasks
:param issues_to_check: list of issues to check
:return: A list of tasks not in Todoist
"""
missing_tasks = []
for issue in issues_to_check:
2021-11-06 20:57:32 +01:00
content = "[{title}]({url})".format(title=issue["title"],
url=issue["web_url"])
if content not in [t["content"] for t in tasks]:
2021-11-06 20:54:28 +01:00
missing_tasks.append({"content": content})
2021-11-06 20:07:57 +01:00
return missing_tasks