Why cant i access org-jira-get-issue-by-id until I have run a jira command like org-jira-get-issue
Opened this issue · 5 comments
Feel free to use this code I wrote the code below so i can complete the summary from a jira id usefull for commit messages and org timesheets.
How ever I notice org-jira-get-issue-by-id is not available instantly, if i run org-jira-get-issue first it works, is there something i can do to improve this ?
(defun org-jira-get-summary ()
"insert summary next to ticket id from jira"
(interactive)
(let ((jira_id (thing-at-point 'symbol)))
(forward-symbol 1)
(insert (format " - %s"
(cdr (assoc 'summary (car (org-jira-get-issue-by-id jira_id))))))))
(defun org-jira-get-summary-url ()
"insert summary next to ticket id from jira with url link"
(interactive)
(let ((jira_id (thing-at-point 'symbol)))
(sp-kill-symbol 1)
(insert (format "[[%s][%s]] - %s" (concatenate 'string jiralib-url "browse/" jira_id) jira_id
(cdr (assoc 'summary (car (org-jira-get-issue-by-id jira_id))))))))
org-jira-get-issue-by-id is not autoloaded, so unless you explicitly (require 'org-jira), it won't be available (until something that is autoloaded, such as org-jira-get-issue) is run.
Okay great I will make that change, would you like to see something like this in org-jira if i did a PR ?
Seems it might be handy for other users.
So this allows you to expand something like EX-1 into the full summary stored on Jira?
You may have to slightly revise the code, as I just had a PR merged that changes org-jira-get-issue-by-id to no longer be interactive but take the issue-id directly.
Yes, it takes the symbol under your point and either appends the summary or in case of the url version it replaces the id with a link and a summary.
Okay not sure what change I would need i am already passing in the ID from my function so it does not ask the user anyway, it just takes the id from the symbol under your cursor.
Anyway if you would like it I dont mind putting in a PR
Sure, please make one here, as this repo is in the process of having it's MELPA source updated to point here https://github.com/ahungry/org-jira