about summary refs log tree commit diff
path: root/org-clubhouse.el
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2019-02-18T21·31-0500
committerGriffin Smith <root@gws.fyi>2019-02-18T21·31-0500
commit813710f2610a2c7ec2d26da29f5b9e4621edf5b0 (patch)
tree32ddc6e0289a8517b571cfd1c5fee094134891cf /org-clubhouse.el
parent910a6af62700aa5ecc9b7da73ad41bcd1fb451c9 (diff)
feat: Add original clubhouse story name to props
When linking clubhouse stories to headlines, save the name of the
clubhouse story as a property on the headline - useful for reference!
Diffstat (limited to 'org-clubhouse.el')
-rw-r--r--org-clubhouse.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/org-clubhouse.el b/org-clubhouse.el
index f11e938f6d61..d6db3bf18589 100644
--- a/org-clubhouse.el
+++ b/org-clubhouse.el
@@ -588,7 +588,7 @@ If the epics already have a CLUBHOUSE-EPIC-ID, they are filtered and ignored."
      :data
      (json-encode params))))
 
-(defun org-clubhouse-populate-created-story (elt story)
+(cl-defun org-clubhouse-populate-created-story (elt story &key extra-properties)
   (let ((elt-start  (plist-get elt :begin))
         (story-id   (alist-get 'id story))
         (epic-id    (alist-get 'epic_id story))
@@ -616,6 +616,10 @@ If the epics already have a CLUBHOUSE-EPIC-ID, they are filtered and ignored."
       (org-set-property "story-type"
                         (alist-get-equal story-type org-clubhouse-story-types))
 
+      (dolist (extra-prop extra-properties)
+        (org-set-property (car extra-prop)
+                          (alist-get (cdr extra-prop) story)))
+
       (org-todo "TODO"))))
 
 (defun org-clubhouse-create-story (&optional beg end &key then)
@@ -874,7 +878,10 @@ resulting stories at headline level LEVEL."
   (interactive)
   (org-clubhouse-prompt-for-story
    (lambda (story)
-     (org-clubhouse-populate-created-story (org-element-find-headline) story)
+     (org-clubhouse-populate-created-story
+      (org-element-find-headline)
+      story
+      :extra-properties '(("clubhouse-story-name" . name)))
      (org-todo
       (org-clubhouse-workflow-state-id-to-todo-keyword
        (alist-get 'workflow_state_id story))))))