Skip to content

Commit

Permalink
Create function to build Org Roam node from Jira issue
Browse files Browse the repository at this point in the history
  • Loading branch information
alecigne committed Apr 22, 2023
1 parent 01a00ae commit fd5f51a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions lisp/alc/alc-work.el
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,28 @@
(interactive)
(insert-file (car (last (org-roam-dailies--list-files)))))

;; TODO It would be nice if the slug was built from the issue ID.
(defun alc-work-jira-create-roam-node (issue-id)
"Create and populate an Org roam node from a Jira issue ID."
(region-or-prompt "Jira ID: ")
(let ((title (alc-work-jira-get-issue-title issue-id)))
(org-roam-capture-
:node (org-roam-node-create
:title title
:tags ":issue:"
:aliases issue-id)
:templates '(("d" "default" plain "%?"
:target
(file+head
"%<%Y%m%d%H%M%S>-${slug}.org"
":PROPERTIES:
:ID: ${id}
:ROAM_ALIASES: ${aliases}
:END:
#+title: ${title}
#+filetags: ${tags}")
:unnarrowed t)))))

;; * Wrapping up

(provide 'alc-work)

0 comments on commit fd5f51a

Please sign in to comment.