marcusolsson / obsidian-projects

Plain text project planning in Obsidian
Apache License 2.0
1.39k stars 55 forks source link

Support tasks #442

Open ltroj opened 1 year ago

ltroj commented 1 year ago

What would you like to be added?

I suggest to add a tasks view which collects - [ ] Tasks from project notes.

In an advanced iteration tasks would be displayed in a kanban view in which columns yould be set to due dates (overdue, today, tomorrow, ..., done) or columns could be set to any frontmatter field (status, etc.).

It would also be possible to group tasks by their parent notes (in a kind of card view).

The tasks view should support the syntax of obsidian-tasks as it's the most popular tasks plugin.

- [ ] This is obsidian-tasks syntax 🔼 🛫 2023-02-25 ⏳ 2023-02-26 📅 2023-02-27 #myProject

Please see obsidian-cardboard for a similar implementation.

Why is this needed?

obsidian-projects is note-based which is a great concept. However, I dislike to create notes for single tasks as it clutters my project folders and there already is a standard markdown element for tasks ( - [ ] Tasks).

In order to manage a project successfully we need some kind of task management.

Right now I use obsidian-projects to manage the "big blocks" of a project and rely on separate notes with custom data queries to collect tasks from project notes and group them by tags or due dates.

I would very much prefer to see the "small blocks" of the projects (aka tasks) wihin obsidian-projects.

A workaround would be the custom note view which would allow to pull my tasks agenda note into obsidian-projects.

marcusolsson commented 1 year ago

I fully intend to support tasks in a future version of Projects. So far, my idea is to treat tasks within notes the way Trello does checklists.

proxy-image

I'm not sure it would help your case specifically, but I think this would be the cleanest abstraction for tasks support. Of course, this would let checklist be embedded in each view. For example, you could imagine including tasks in a Board card, or in the Table view, just like any other field.

Implementation-wise, it's a little tricky, but I think tasks would need to be implemented as some form of implicit field.

ltroj commented 1 year ago

That's great news and exactly what I was looking for!

Honestly this feature + the timeline/Gantt view would make the Projects plugin a complete project management tool.

bepolymathe commented 1 year ago

Yes ! I can’t wait for that. Is there somewhere an example of using project plugin to manage tasks as note (curious) ?

ltroj commented 1 year ago

Yes ! I can’t wait for that. Is there somewhere an example of using project plugin to manage tasks as note (curious) ?

Not sure if that's what you were looking for but I wrote a bit about task management in addition to the Projects plugin as well as the Kanban plugin. Maybe it's helpful for now.

joesabelja commented 1 year ago

+1 on this feature.

yilo commented 1 year ago

how about integrate with existing kanban plugin features directly?

bepolymathe commented 11 months ago

Any news on this front ?

Acylation commented 11 months ago

@bepolymathe, implementing this feature would require significant effort if we aim to index the body text or extract in-text information ourselves. Obsidian has made tasks accessible through MetadataCache class in the api, and there are some other plugins tracking tasks. I’ll find some examples to help implementing this.

From another perspective, as we develop the feature for editing dataview projects, we cannot bypass the main text. Ideally, I hope that third-party APIs we use to back-writting a dataview value can also handle tasks, not just the dataview implicit fields.

I have a tight schdule recently and won't be available until Dec on complex features. Once I start working on this you will see a correponding PR.

Edit: related issues #149, #151(partly), #164, and the last section in #76

bepolymathe commented 11 months ago

@bepolymathe, implementing this feature would require significant effort if we aim to index the body text or extract in-text information ourselves. Obsidian has made tasks accessible through MetadataCache class in the api, and there are some other plugins tracking tasks. I’ll find some examples to help implementing this.

From another perspective, as we develop the feature for editing dataview projects, we cannot bypass the main text. Ideally, I hope that third-party APIs we use to back-writting a dataview value can also handle tasks, not just the dataview impllicit fields.

I have a tight schdule recently and won't be available until Dec on complex features. Once I start working on this you will see a correponding PR.

Ok Thanks for reply and your effort.

BillyCottrell commented 7 months ago

Hi,

Any progress on this? I am also really interested in seeing some sort of implementation for this since it could be nice alternative to ticketing systems aswell.

I'll drop what I have made so far for the folks that are interested, but I have made some sort of a workaround for this, and so far I am able to create a note per task from my project view (but I can't edit it completely yet, I mean I can edit from project but the task isn't updated or vice versa).

Hope this might help someone!

Thx!

My Setup

I am using the plugins:

What I did was I created a project that looks at my issue folder and creates new notes with the name Issue {{date:YYYYMMDD}}{{time:HHmmss}} - New Issue and uses my template "Issue Template".

The issue template looks like this:

<%*
// Open the tasks Modal
const tasksApi = this.app.plugins.plugins['obsidian-tasks-plugin'].apiV1;
let taskline = await tasksApi.createTaskLineModal();

// Set title of file, so it replaces the "New Issue" part with the description of the task
let fileTitle = tp.file.title;
var descSearch = taskline.match(/(?<=\] )[^[\]]*(?= \[)/g);
var description = descSearch.length>0 ? descSearch[0] : "";
var titleSearch = fileTitle.match(/(Issue [0-9]* - New Issue)/);
if(titleSearch.length>0) {
  let issueTag = fileTitle.match(/(Issue [0-9]* - )/)[0];
  let newTitle = `${issueTag} ${description}`
  await tp.file.rename(newTitle);
}

// Get every task property like "priority" etc get their values and add everything to frontmatter
var keys = taskline.match(/(?<=\[\s*)(\w+)/g);
var values = taskline.match(/(?<=[:]+\s)(.[^\]]+)/g)
tR+="---\n";
tR+="description: " + description + "\n";
for(var i = 0; i<keys.length;i++) {
  tR+=keys[i] + ": " + values[i] +"\n";
}
tR+="---";
%>
# Task:
<% taskline %>

Which basically creates a note with the task based on the modal and sets the properties of the file to the properties of the task. So now I am able to use tasks in both regular dashboards and obsidian-tasks-calendar aswell as use it inside the project view. Only problem is that repeating tasks aren't repeated on the calendar within project. But the Obsidian-tasks-calendar is capable of doing this, so if this could be added into projects that would be nice to have aswell (so something like start and end date).

Now I just need to update the editing part so both the properties and the task values are updated correspondingly, so if I edit the task the properties get changed and vice versa. That way I could edit tasks from project which also will edit the tasks correspondingly.

Feel free to use this btw, if you have any remarks on this let me know could be interesting to improve this setup!