From 813710f2610a2c7ec2d26da29f5b9e4621edf5b0 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Mon, 18 Feb 2019 16:31:05 -0500 Subject: 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! --- org-clubhouse.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'org-clubhouse.el') 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)))))) -- cgit 1.4.1