taskwarrior icon indicating copy to clipboard operation
taskwarrior copied to clipboard

ID field and attribute modifiers

Open ashprice opened this issue 2 years ago • 1 comments

This seems to be an issue with documentation at the very least. I've seen the case of wanting to match all tasks that depend on another disucssed in an issue, but take this case: You have three tasks, and due to extraneous factors they have become bumped in priority above all other tasks in the project. You could modify their priority tags or add tags to boost urgency with a high uda for the tag, but a ready solution would seem to be matching all other pending tasks in the project, and modifying them such that they depend on the three tasks.

So I am not sure if there is a more obvious way to do this, but the way I figured was most obvious was to do task ID.not:4,10,52 status:pending proj:Foo mod dep:4,10,52, along with variations on this, such as just not, ID.hasnt, with uuids, by specifying individual ID's with the not modifier and going one by one (and with or statements), etc. This would be how I would expect it to work given the documentation, but as far as I can tell it simply doesn't.

The way I am doing it is using the desc field as a work around, which is quite verbose:

task "desc.hasnt:foo" and "desc.hasnt:bar" and "desc.hasnt:fee" proj:Foo status:pending mod dep:$(task "desc.has:foo" proj:Foo _unique id),$(task "desc.has:bar" proj:Foo _unique id),$(task "desc.has:fee" proj:Foo _unique id)

Probably I could reduce the verbosity a bit by leveraging my shell, but even so, this doesn't seem ideal.

ashprice avatar Sep 03 '23 12:09 ashprice

This seems a pretty heavy-handed way to use dependencies, but I think your approach to querying for the modify is a good one.

I think hasnt is the opposite of has and is meant for containers, although I admit I don't understand the DOM or relevant command-line syntax very well.

There is a "NOT" boolean operator, so perhaps you could do something like task not (4,10,52)?

djmitche avatar Dec 21 '23 04:12 djmitche