Todoist now allows to enter “sections” in their quick entry.
For example, in my project Goals, I have the sections “monthly” and “12 week”.
In the quick entry mode I can add:
write my essay #goals /monthly @review
And a task will be added for “write my essay” in project “goals” under section “monthly” with tag “review”.
The tricky bit is the space between projects and sections.
I have the following action in drafts which works great. Now I’d like to have the section part but I don’t know how to add it into my script (if at all possible)?
I’ve tried to simply add /monthly to the script after #goals but it didn’t work
Any ideas?
// create task in Todoist inbox for each line in the draft
let lines = draft.content.split("\n");
let todoist = Todoist.create();
let ctErrors = 0;
let endOfMonth = Date.today().moveToLastDayOfMonth().toString("dd/MM/yyyy");
let lineAddition = " #goals @review " + endOfMonth;
for (let line of lines) {
if (line.length > 0) {
line += lineAddition;
let success = todoist.quickAdd(line);
if (success) {
console.log("Todoist task created: " + line);
}
else {
ctErrors++;
console.log("Todoist error: " + todoist.lastError);
}
}
}
if (ctErrors > 0) {
context.fail();
}