Hi, I'm using Org to manage a project. I need to output a tasks list for every of my colleagues, person per person. I'm currently using tags to assing people to tasks (even if I'm not completely convinced that this is the right way to go). What I would like is to generate a dynamic block for each person with all tasks assigned to that person. This means, list all headings with a given tag. Could someone tell me how to do that? I tried using Babel to output a custom report where I will be able to (not yet done) easily filter by tag. But I'm already blocked with such a code: --8<---------------cut here---------------start------------->8--- #+begin_src emacs-lisp :results output (with-output-to-string (org-agenda nil "a")) #+end_src --8<---------------cut here---------------end--------------->8--- It does not produce any output. Any idea? Thanks, Francesco _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode-mXXj517/zsQ@public.gmane.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Francesco Pizzolante <fpz@missioncriticalit.com> writes: > I'm using Org to manage a project. > > I need to output a tasks list for every of my colleagues, person per person. > > I'm currently using tags to assing people to tasks (even if I'm not completely > convinced that this is the right way to go). Babel is of course one way to do this. Another way would be to export your org file to taskjuggler[1] and define a resourcereport[2] which shows you all the resources and their tasks. The tutorial has an example screen shot where you see a resource report[3]. Hope that helps Christian Footnotes: [1] http://orgmode.org/worg/org-tutorials/org-taskjuggler.php [2] http://www.taskjuggler.org/manual-2.4.3/generating_reports_of_the_scheduled_projects.html [3] http://orgmode.org/worg/images/taskjuggler/resource-graph.png -- Christian Egli Swiss Library for the Blind, Visually Impaired and Print Disabled Grubenstrasse 12, CH-8045 Zürich, Switzerland
Francesco Pizzolante <fpz-djc/iPCCuDYQheJpep6IedvLeJWuRmrY@public.gmane.org> writes: > Hi, > > I'm using Org to manage a project. > > I need to output a tasks list for every of my colleagues, person per person. > > I'm currently using tags to assing people to tasks (even if I'm not completely > convinced that this is the right way to go). > > What I would like is to generate a dynamic block for each person with all > tasks assigned to that person. This means, list all headings with a given tag. > > Could someone tell me how to do that? I'm not sure if this is what you are after, but one way is to use custom agenda commands and then to save the agenda as a txt file: The following pages have good information on creating block agenda with custom commands: http://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.php http://orgmode.org/manual/Block-agenda.html#Block-agenda E.g., --8<---------------cut here---------------start------------->8--- (add-to-list 'org-agenda-custom-commands '("D" "Delegated tasks" ((tags-todo "Jenny") (tags-todo "Archie") (tags-todo "George")))) --8<---------------cut here---------------end--------------->8--- Once you create a custom agenda command, you can simply save it as txt by typing C-x C-w and the filename + relevant extension. Another option is to use a babel block and org-map-entries to spit out a simple list of tasks for each person: --8<---------------cut here---------------start------------->8--- #+source: tasklist #+begin_src emacs-lisp :var person="me" (let (tasklist) (org-map-entries (lambda () (add-to-list 'tasklist (concat "- " (nth 4 (org-heading-components))))) (concat person "/!TODO") 'agenda) (mapconcat 'identity tasklist "\n")) #+end_src #+call: tasklist(person="Jenny") --8<---------------cut here---------------end--------------->8--- Add this to an org file, replace Jenny with the appropriate name, and type C-c C-c to spit out a list (of all TODO items tagged with the relevant name) that looks like this: --8<---------------cut here---------------start------------->8--- #+results: tasklist(person="Jenny") #+begin_example - Call George - Call Archie - Estimate cost of widgets --8<---------------cut here---------------end--------------->8--- You could do something similar with dynamic block function. HTH, Matt
Hi Matt,
Thanks a lor for you answer.
I preferred your second suggestion as I can add it directly to my Org buffer:
> --8<---------------cut here---------------start------------->8---
> #+source: tasklist
> #+begin_src emacs-lisp :var person="me"
> (let (tasklist)
> (org-map-entries
> (lambda ()
> (add-to-list 'tasklist
> (concat "- " (nth 4 (org-heading-components)))))
> (concat person "/!TODO") 'agenda)
> (mapconcat 'identity tasklist "\n"))
> #+end_src
>
> #+call: tasklist(person="Jenny")
> --8<---------------cut here---------------end--------------->8---
>
> Add this to an org file, replace Jenny with the appropriate name, and
> type C-c C-c to spit out a list (of all TODO items tagged with the
> relevant name) that looks like this:
>
> --8<---------------cut here---------------start------------->8---
> #+results: tasklist(person="Jenny")
> #+begin_example
> - Call George
> - Call Archie
> - Estimate cost of widgets
> --8<---------------cut here---------------end--------------->8---
Currently you code returns todo items with the todo keyword "TODO" only.
What do I have to change in order to get all todo items with selected todo
keyword? As an example, I'd like to keep in the lists the todo items with TODO
and STARTED but not the ones marked as DONE, WAIT or NEW.
Thanks again for your help.
Regards,
Francesco
Hi Matt,
> Another option is to use a babel block and org-map-entries to spit out a
> simple list of tasks for each person:
>
> --8<---------------cut here---------------start------------->8---
> #+source: tasklist
> #+begin_src emacs-lisp :var person="me"
> (let (tasklist)
> (org-map-entries
> (lambda ()
> (add-to-list 'tasklist
> (concat "- " (nth 4 (org-heading-components)))))
> (concat person "/!TODO") 'agenda)
> (mapconcat 'identity tasklist "\n"))
> #+end_src
>
> #+call: tasklist(person="Jenny")
> --8<---------------cut here---------------end--------------->8---
>
> Add this to an org file, replace Jenny with the appropriate name, and
> type C-c C-c to spit out a list (of all TODO items tagged with the
> relevant name) that looks like this:
>
> --8<---------------cut here---------------start------------->8---
> #+results: tasklist(person="Jenny")
> #+begin_example
> - Call George
> - Call Archie
> - Estimate cost of widgets
> --8<---------------cut here---------------end--------------->8---
Thanks a lot for your great help.
I've played a little with the code you've sent and here's what I end up with:
--8<---------------cut here---------------start------------->8---
#+source: tasklist
#+begin_src emacs-lisp :var person="FPZ" :results raw
(setq org-agenda-files (list (buffer-file-name)))
(let (tasklist)
(add-to-list 'tasklist "|<c>|||" t)
(org-map-entries
(lambda ()
(let ((priority (nth 3 (org-heading-components))))
(add-to-list 'tasklist
(concat "| *" (nth 2 (org-heading-components)) "* "
"|/[#" (char-to-string (if priority
priority ?B)) "]/ "
"| [[" (nth 4 (org-heading-components)) "]]|") t)))
(concat person "/!TODO|STARTED|WAIT") 'agenda)
(mapconcat 'identity tasklist "\n"))
#+end_src
--8<---------------cut here---------------end--------------->8---
This enables to get a table with a task per row. For each task, I get the TODO
keywork, the priority and a link to the corresponding section in my Org
buffer.
Here'a an example from one of my document:
--8<---------------cut here---------------start------------->8---
#+results: tasklist
| <c> | |
|
| *WAIT* | /[#C]/ | [[See if we have to filter the processes
against something else]] |
| *WAIT* | /[#C]/ | [[See if we have to filter the products against
something else than the branch]] |
| *STARTED* | /[#A]/ | [[Display static party questions block]]
|
| *WAIT* | /[#C]/ | [[Analyse the risk management screen]]
|
--8<---------------cut here---------------end--------------->8---
This is really great as each person can now have a quick overview of their
tasks and they just jave to click to get the details of the tasks!
The next step for me, would be to be able to sort this table against
priorities for instance.
If you think about a simple way of doing this, please let me know.
Regards,
Francesco
On Thu, Dec 16, 2010 at 1:19 PM, Francesco Pizzolante <fpz@missioncriticalit.com> wrote: > > Another option is to use a babel block and org-map-entries to spit out a > > simple list of tasks for each person: > I've played a little with the code you've sent and here's what I end up with: > > --8<---------------cut here---------------start------------->8--- > #+source: tasklist > #+begin_src emacs-lisp :var person="FPZ" :results raw > (setq org-agenda-files (list (buffer-file-name))) > (let (tasklist) > (add-to-list 'tasklist "|<c>|||" t) > (org-map-entries > (lambda () > (let ((priority (nth 3 (org-heading-components)))) > (add-to-list 'tasklist > (concat "| *" (nth 2 (org-heading-components)) "* " > "|/[#" (char-to-string (if priority > priority ?B)) "]/ " > "| [[" (nth 4 (org-heading-components)) "]]|") t))) > (concat person "/!TODO|STARTED|WAIT") 'agenda) > (mapconcat 'identity tasklist "\n")) > #+end_src > --8<---------------cut here---------------end--------------->8--- > > The next step for me, would be to be able to sort this table against > priorities for instance. > > If you think about a simple way of doing this, please let me know. I had the same problem, and tweaking your code (I think org-mode doesn't like the modification of org-agenda-files) this is what I've ended up with: (defun tasks-with-tag (person &optional scope) (let ((tasklist ())) (org-map-entries (lambda () (let ((priority (nth 3 (org-heading-components)))) (add-to-list 'tasklist (list (if priority (char-to-string priority) "C") (concat "[[" (nth 4 (org-heading-components)) "]]")) t))) (concat person "/!TASK") scope) (sort tasklist (lambda (f s) (string-lessp (car f) (car s)))))) The output is sorted and makes a nice table. Scope is passed directly to org-map-entries, so if you leave it out the scope will be the current buffer. Greetings, jm -- http://juanreyero.com/ http://alandair.com
Hi Francesco,
Sorry for the delay in responding...
Francesco Pizzolante <fpz@missioncriticalit.com> writes:
> It seems to work at first sight, but when I try C-c C-v e on this line
> "#+call: tasklist(person="me") :exports results" then the end of my buffer
> gets modified this way:
>
> #+call: tasklist(person="me") :exports results
>
> #+results: tasklist(person="me")
> #+begin_example
> - Lui écrire un mail
> - Tester le bout de code de mon élève
>
>
> ** For Jenny
>
> #+end_example
> #+call: tasklist(person="me") :exports results
>
> #+results: tasklist(person="Jenny")
> #+begin_example
> - Voir si le pantalon lui va bien
> - Appeler Georges
> #+end_example
>
> Which is a complete mess...
Could you please explain what is a complete mess above? The lack of an
enclosing comment block? You can tweak the way in which the results are
placed in the buffer by modifying the :results header. For
instance, :results raw will simply spit out an unadorned org-mode list.
(info "(org) results")
Best,
Matt