Skip to content

Commit

Permalink
Added org-jira-refresh-issues-in-buffer-loose()
Browse files Browse the repository at this point in the history
  • Loading branch information
NimSed committed Jul 1, 2022
1 parent 44fe1d9 commit 05208a3
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions org-jira.el
Original file line number Diff line number Diff line change
Expand Up @@ -1939,6 +1939,38 @@ Used in org-jira-read-resolution and org-jira-progress-issue calls.")
resolutions))))
(cons 'name resolution-name))))

(defun org-jira-refresh-issues-in-buffer-loose ()
"""
Iterates over all level 1-2 headings in current buffer, refreshing on issue :ID:.
It differs with org-jira-refresh-issues-in-buffer() in that:
a) It accepts current buffer and its corresponding filename, regardless of whether
it has been previously registered as an org-jira project file or not.
b) It doesn't expect a very specific structure in the org buffer, but simply goes
over every existing heading (level 1-2), and refreshes it IFF a valid jira ID
can be detected in it.
"""
(interactive)
(save-excursion
(save-restriction
(widen)
(outline-show-all)
(outline-hide-sublevels 2)
(goto-char (point-min))

(while (not (eobp))
(progn
(if (org-jira-id)
(progn
(org-jira--refresh-issue (org-jira-id) (file-name-sans-extension buffer-file-name) )
)
)
(outline-next-visible-heading 1)
)
)
)
)
)

;; TODO: Refactor to just scoop all ids from buffer, run ensure-on-issue-id on
;; each using a map, and refresh them that way. That way we don't have to iterate
;; on the user headings etc.
Expand Down

0 comments on commit 05208a3

Please sign in to comment.