about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTatu Lahtela <tatu.lahtela@vincit.fi>2020-06-12T08·31+0300
committerGriffin Smith <glittershark@users.noreply.github.com>2020-06-15T13·11-0400
commit8838454236cd448afa2c752c4a6dc6f4bb7a3bf4 (patch)
treeb3b8d969340d69eae8837089a7bb0c80432c062d
parentf00c22a49af3798c8a4be6d1831b5142ff56a19e (diff)
Add function to add a single headline from my tasks
Add function to create single story element from a prompted list of active stories.
-rw-r--r--org-clubhouse.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/org-clubhouse.el b/org-clubhouse.el
index 884c8d288f..e6e29b5751 100644
--- a/org-clubhouse.el
+++ b/org-clubhouse.el
@@ -1030,6 +1030,21 @@ which labels to set."
                     "\n")
        ""))))
 
+(defun org-clubhouse-headline-from-my-tasks (level)
+  "Prompt my active stories and create a single `org-mode' headline at LEVEL."
+  (interactive "*nLevel: \n")
+  (if org-clubhouse-username
+      (let* ((story-list (org-clubhouse--search-stories
+                          (format "owner:%s !is:done !is:archived"
+                                  org-clubhouse-username)))
+             (stories (to-id-name-pairs story-list)))
+        (org-clubhouse-headline-from-story-id level
+                                              (find-match-in-alist
+                                               (ivy-read "Select Story: "
+                                                         (-map #'cdr stories))
+                                               stories)))
+    (warn "Can't fetch my tasks if `org-clubhouse-username' is unset")))
+
 (defun org-clubhouse-headline-from-story-id (level story-id)
   "Create a single `org-mode' headline at LEVEL based on the given clubhouse STORY-ID."
   (interactive "*nLevel: \nnStory ID: ")