Fetch jira summary from JIRA-ID under cursor with emacs
rss_feed

Fetch jira summary from JIRA-ID under cursor with emacs

homeHome
pagesemacs
pageslisp

The below snippet will grab the JIRA-ID under your cursor and use it to look up the summary and past it next to the JIRA-ID.

You need to have org-jira installed because this makes use of org-jira-get-issue-by-id to look up the ticket details.

1
2
3
4
5
6
7
(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))))))))

This next snippet does the same as the first except it also replaces the ID with a link back to jira

1
2
3
4
5
6
7
(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))))))))

You will need to also place the code below some where to make the jira methods available, hopefully these will be merged directly into org jira soon.

1
(require 'org-jira)