taskwarrior icon indicating copy to clipboard operation
taskwarrior copied to clipboard

[TW-122] Allow creation of a recurring task / sub-task pair

Open taskwarrior opened this issue 6 years ago • 10 comments

Jennifer Cormier on 2012-02-25T00:53:44Z says:

I would like to create a recurring task (T) with a sub-task (S). I can make task T depend on the first instance of sub-task S (S-1). But then when a new instances of task T are created, they all depend on S-1, rather than later instances.

i.e. I'd like the tasks to work as follows

1 (hidden) recur:weekly due:Thursday -- Draft report
2 (visible) recur:weekly due:02/09/2012 -- Draft report
3 (hidden) recur:weekly due:Friday -- Finalize report
4 (visible) recur:weekly due:02/10/2012 dep:2 -- Finalize report
5 (visible) recur:weekly due:02/16/2012 -- Draft report
6 (visible) recur:weekly due:02/17/2012 dep:5 -- Finalize report

But task 6 depends on task 2 unless I manually modify task 6 to depend on task 5 instead. And such a manual modification needs to be made each week for the new tasks generated.

It's not difficult to come up with scenarios in which such a feature would be quite useful. E.g. a 5 step process that needs to be done monthly, such as: draft report, submit for review, update based on feedback, have it signed, submit.

taskwarrior avatar Feb 12 '18 18:02 taskwarrior

Migrated metadata:

Created: 2012-02-25T00:53:44Z
Modified: 2017-01-16T16:23:24Z

taskwarrior avatar Feb 12 '18 18:02 taskwarrior

Paul Beckingham on 2012-02-25T16:04:23Z says:

Remember when I said this stuff was mind-boggling?

Here is what I think I understand of the request. Please correct me if I'm wrong.

You want to create two tasks, "Draft Report" and "Finalize Report", where the latter depends on the first, which makes sense. Then in making both of these tasks recurring weekly, you want their subsequent weekly instances to maintain that dependency relationship?

So Friday's "Finalize" task depends on Thursday's "Draft" task. Then next Friday's "Finalize" depends on next Thursday's "Draft" task. and so on.

Yikes. That's not easy. But then again, if the recurrence periods match, I don't see why it should not be supported. I would need lots of coffee before tackling this one.

taskwarrior avatar Feb 12 '18 18:02 taskwarrior

Aikido Guy on 2012-02-25T16:07:14Z says:

I'll buy you a coffee Paul! just so you'll be ready :) umm... how does that work over the internet?? :)

taskwarrior avatar Feb 12 '18 18:02 taskwarrior

Paul Beckingham on 2012-02-25T16:19:17Z says:

Aikido Guy wrote:

I'll buy you a coffee Paul! just so you'll be ready :) umm... how does that work over the internet?? :)

It's not buying it that is the problem. I need you to show up and make it, then operate the mainline.

taskwarrior avatar Feb 12 '18 18:02 taskwarrior

Jennifer Cormier on 2012-02-25T20:21:02Z says:

Paul Beckingham wrote:

So Friday's "Finalize" task depends on Thursday's "Draft" task. Then next Friday's "Finalize" depends on next Thursday's "Draft" task. and so on.

Yes, that's exactly what I'm looking for. Thanks for considering it!

taskwarrior avatar Feb 12 '18 18:02 taskwarrior

Flo Kremser on 2014-06-29T17:28:40Z says:

I would also like to see this. Additionally, this feature of a chain of tasks with dependencies should also be possible outside of recurring task, i.e. it would be cool if you could create templates of task chains.

taskwarrior avatar Feb 12 '18 18:02 taskwarrior

This is a feature I am VERY interested in.

I'm using TaskWarrior to re-inforce habits I'm trying to take. 2 of them are daily habits: writing a journal entry, and focusing a bit on a blog entry. I want to focus on the blog only after finishing the journal entry for personal reasons unrelated to the request.

Therefore, I'd like the following commands:

$ task add "write jrnl entry" recur:daily due:today+22h sched:today
Created task 65 (recurrence template)
$ task add "Focus 15 min on blogging" recur:daily due:today+23h sched:today depends:65
Created task 67 (recurrence template)

to create the following tasks

  • task 66 "write jrnl entry" due:today
  • task 68 "Focus 15 min on blogging" due:today depends:66
  • task 69 "write jrnl entry" due:tomorrow
  • task 70 "Focus 15 min on blogging" due:tomorrow depends:69
  • ….

AdrienLemaire avatar May 24 '19 01:05 AdrienLemaire

What would be very helpful if the last created task's ID # were stored into a variable that can be used on the command line or in a script for a depends:$var.

I came looking to see whether anyone had created task sets or if someone had suggested the feature — where we can basically create a template ("Podcast") which when fired off allows a variable for this instance name $n & would create the string of tasks & dependencies (outline $n episode; record $n episode; edit $n episode; write $n shownotes; upload $n episode; market $n episode).

These types of projects/tasks are not recurring necessarily (just because an episode may be released every Monday doesn't mean they're recorded weekly on Sunday - one might create them as inspiration hits, or do 26 in one month and schedule the next 6 months of episodes, etc.). However it's a very predictable repeated process.

Same for say processing a new client or customer — you don't choose when you get a new customer, but when you get a new customer, you may have a predictable chain of events you need to create regarding said customer.

$ task set NewCustomer "Jack Daniels"
Created task 65 call Jack Daniels for needs discovery
Created task 66 add Jack Daniels info to CRM database depends:65
Created task 67 email Jack Daniels for proposal verification depends:66
Created task 68 create proposal for Jack Daniels depends:67
Created task 69 send Jack Daniels new proposal depends:68

This wouldn't be too hard to do with a bash script. But it would be nice if these were stored with taskwarrior and inherent to the application so folk didn't have to learn how to script in bash and create a directory of separate scripts.

That said, has anyone created scripts to do this yet? lol

Oh, I pretended the command is "set" like a set in mathematics. But it could be whatever command word is available/desired.

Crisses avatar Nov 25 '20 13:11 Crisses

I think one could maybe link to the recurrence mask and then have task verify whether there's not completed instances of that task before unblocking the latter task. That is link task "finalize" to recurrence mask of task "draft" and whenever there's a pending instance of "draft" "finalize" is blocked.

The main problem I see is that there is one task always created in advance (or more if specified in the config). These tasks are probably just marked as waiting. Thus there would always be a non-completed instance of a recurring mask. But waiting tasks must be respected otherwise the task "finalize" would be unblocked when task "draft" would be tagged +WAITING.

Also you'd have two "drafts" to be completed before either "finalize" task is unblocked. That may not be desired.

jaker-dotcom avatar Jan 02 '22 14:01 jaker-dotcom

I too would love to see this feature! Similarly I'd love to see something like an automatic checklist add. For instance any time a task with the tag +Traveling pops up Taskwarrior could add subtasks in a checklist of: Pack your toothbrush, Pack a change of clothes, Water the plants. and so on.

fullstopslash avatar Jan 13 '22 19:01 fullstopslash