Skip to content

Commit

Permalink
Adding org-jira-update-issue-labels and setting a keybinding.
Browse files Browse the repository at this point in the history
  • Loading branch information
djgoku committed Sep 28, 2024
1 parent e514d05 commit a1aaeef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ Some of the important keybindings:
(define-key org-jira-map (kbd "C-c ig") 'org-jira-get-issues)
(define-key org-jira-map (kbd "C-c ij") 'org-jira-get-issues-from-custom-jql)
(define-key org-jira-map (kbd "C-c ih") 'org-jira-get-issues-headonly)
(define-key org-jira-map (kbd "C-c il") 'org-jira-update-issue-labels)
(define-key org-jira-map (kbd "C-c iu") 'org-jira-update-issue)
(define-key org-jira-map (kbd "C-c iw") 'org-jira-progress-issue)
(define-key org-jira-map (kbd "C-c in") 'org-jira-progress-issue-next)
Expand Down
11 changes: 11 additions & 0 deletions org-jira.el
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ See `org-default-priority' for more info."
(define-key org-jira-map (kbd "C-c ih") 'org-jira-get-issues-headonly)
;;(define-key org-jira-map (kbd "C-c if") 'org-jira-get-issues-from-filter-headonly)
;;(define-key org-jira-map (kbd "C-c iF") 'org-jira-get-issues-from-filter)
(define-key org-jira-map (kbd "C-c il") 'org-jira-update-issue-labels)
(define-key org-jira-map (kbd "C-c iu") 'org-jira-update-issue)
(define-key org-jira-map (kbd "C-c iw") 'org-jira-progress-issue)
(define-key org-jira-map (kbd "C-c in") 'org-jira-progress-issue-next)
Expand Down Expand Up @@ -1690,6 +1691,16 @@ purpose of wiping an old subtree."
(ensure-on-issue
(org-jira-get-issues-headonly (jiralib-do-jql-search (format "parent = %s" (org-jira-parse-issue-id))))))

;;;###autoload
(defun org-jira-update-issue-labels ()
"Update jira issue labels."
(interactive)
(let* ((labels (org-jira-parse-issue-labels))
(updated-labels (org-jira-read-labels (format "%s, " labels)))
(updated-labels-string (mapconcat 'identity updated-labels ", ")))
(org-set-property "labels" updated-labels-string)
(org-jira-update-issue)))

(defvar org-jira-project-read-history nil)
(defvar org-jira-boards-read-history nil)
(defvar org-jira-sprints-read-history nil)
Expand Down

0 comments on commit a1aaeef

Please sign in to comment.