Action
Tasks in Todoist
Posted by agiletortoise,
Last update
about 4 hours ago
UPDATES
about 4 hours ago
Pass auto_reminder value because the new v1 API seems to no longer respect user’s settings.
Create tasks in the Todoist inbox for each line of the current draft.
For more Todoist examples, visit the Todoist Integration Guide.
Steps
-
script
// create task in Todoist inbox for each line in the draft const autoReminder = true // should automatic reminders be assigned if due date is parsed. let lines = draft.content.split("\n"); let todoist = Todoist.create(); let ctErrors = 0; for (let line of lines) { if (line.length > 0) { let success = todoist.quickAdd(line, "undefined", "undefined", {"auto_reminder": autoReminder}); if (success) { console.log("Todoist task created: " + line); } else { ctErrors++; console.log("Todoist error: " + todoist.lastError); } } } if (ctErrors > 0) { context.fail(); }
Options
-
After Success Default Notification Info Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.