I like to have the creation time of my tasks in org-mode. To that end, I used this reference to setup a hook to add the create time to a new entry. It's working pretty well but I find I'd actually like to log this in the LOGBOOK drawer instead.

This answer (which was actually referenced by the first answer) shows how to insert the CREATED property into the PROPERTIES drawer but for the life of me I can't find how I would modify that to insert into the LOGBOOK drawer instead.

As a follow-up, if someone can tell me where I could have found this that would be awesome. I looked all through the org-mode docs but couldn't really find a complete reference. The worg site has a great reference for hooks and though it says it includes commands, I'm not sure it does (e.g., org-entry-put).

The simplest solution that I can think of but which only works for TODO's from capture templates is to use the following capture template

(setq org-capture-templates
  '(("t" "todo" entry (file "~/org/inbox.org")
     "* TODO %i%? \n:LOGBOOK: \n:CREATED: %U \n:END:")))
  • That's true. Of course it would only work for creating TODOs from the capture template (and I have about a dozen of those that I'd have to update). I'm really trying to intercept the function call. Thanks for the idea, though. – AndyJ Dec 8 at 0:47
  • Yes, I misread your question and will update the answer to reflect the fact that it is incomplete. – andrej Dec 8 at 13:38

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.