Hi all - hoping someone smarter than me can help me out here.
I’m trying to create a scenario for Todoist whereby when I add a task to my Work Backlog project in Todoist, we look for a label. Where none is found, a label gets added to the task corresponding to the section the task is in (perhaps after having been created if a suitable label doesn’t already exist). So, a half made up (to avoid explaining the nuances of my work projects) example would be:
An unlabeled task gets added to the Social Media Campaign section of the WORK BACKLOG project. My scenario should look for a label “WORK | Social Media Campaign” - if it exists, it should be added to the new task; where it doesn’t exist, it should be created and then added to the new task.
To explain why I want this set up as I know I can use the Todist shortcuts to quickly add the label…
My set up essentially uses two projects:
My Work Backlog is where all my work tasks go, broken down by section (one for every real work project, i.e not a Todoist project) and the corresponding section also added as a label. This label is essentially for the second project…
My second project is dedicated to this week and is broken down by task status, i.e. still to do, started doing, do today and doing later. At the start of each week I move tasks from my work backlog (and other backlogs from different parts of my life) into “This Week”. From there, I then try and ‘move them across the board’ to use a stolen agile phrase. Its this second project where the label, corresponding to the real work projects come into their own.
If I could get it that a task added to my work backlog looks for a label and if it doesn’t find one, adds / created and adds one based on the section the task is in, it would be a nice to have…certainly not a need to have though but figure this is a good automation to learn a little with.
So it turns out I wasn’t a million miles off but neither was I scraping the sides! I’ve followed your advice - with a guessed addition that gets all my sections also - but it’s still not quite working for me.
I filter all new tasks by project ID to get only the ones added to my Work Backlog project
I get all the labels using the list labels module
MY GUESSED ADDITION - I list all sections
I use the router and two filters to split my scenario…
Route A: If the label I need already exists
Route B: if the label I need doesn’t already exist
A1. The task created at step 1 is updated with the label
B1. The label I need is created
B2. The task is updated with this new label
The issues seem to be relating to the logic around the part of the scenario where I’m trying to compare the section name against the list of labels and, if a label exists that matches the section name, apply it to the new task and, if it doesn’t exist, create it and then apply it to the new task. In basic tests - where I was simply entering the word test as the the “new” label - the scenario runs through route b. For the first new task it creates the new label but it doesn’t assign it. For the second task, the scenario fails with the error ‘label already exists’ - which is right but this should have resulted in route A being followed.
If the label does not exist, it shouldn’t follow that second path after the router. It should’ve gone to the first path. That means there must be something wrong in the filters that you applied. I need to see how you have applied the filter.