From 9f12f6e74b2af1be7ef26b886b319b4f4f4d276d Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Fri, 24 Apr 2026 18:53:53 +0200 Subject: [PATCH] update org-jira --- .../jiralib.el | 16 ++++-- .../org-jira-autoloads.el | 0 .../org-jira-pkg.el | 6 +-- .../org-jira-sdk.el | 2 + .../org-jira.el | 50 ++++++++++--------- 5 files changed, 45 insertions(+), 29 deletions(-) rename elpa/{org-jira-20240928.2340 => org-jira-20250802.302}/jiralib.el (98%) rename elpa/{org-jira-20240928.2340 => org-jira-20250802.302}/org-jira-autoloads.el (100%) rename elpa/{org-jira-20240928.2340 => org-jira-20250802.302}/org-jira-pkg.el (73%) rename elpa/{org-jira-20240928.2340 => org-jira-20250802.302}/org-jira-sdk.el (98%) rename elpa/{org-jira-20240928.2340 => org-jira-20250802.302}/org-jira.el (98%) diff --git a/elpa/org-jira-20240928.2340/jiralib.el b/elpa/org-jira-20250802.302/jiralib.el similarity index 98% rename from elpa/org-jira-20240928.2340/jiralib.el rename to elpa/org-jira-20250802.302/jiralib.el index 23d4204d..9130cc21 100644 --- a/elpa/org-jira-20240928.2340/jiralib.el +++ b/elpa/org-jira-20250802.302/jiralib.el @@ -466,8 +466,19 @@ request.el, so if at all possible, it should be avoided." :type "POST" :data (json-encode `(,(car (second params)) ,(car (third params)))))) ('getUsers - (jiralib--rest-call-it (format "/rest/api/2/user/assignable/search?project=%s&maxResults=10000" (first params)) - :type "GET")) + (let* ((project (first params)) + (start-at 0) + (max-results 1000) + (all-users '()) + (more-results t)) + (while more-results + (let* ((endpoint (format "/rest/api/2/user/assignable/search?project=%s&startAt=%d&maxResults=%d" + project start-at max-results)) + (response (jiralib--rest-call-it endpoint :type "GET"))) + (setq all-users (append all-users response)) + (setq more-results (>= (length response) max-results)) + (setq start-at (+ start-at max-results)))) + all-users)) ('updateIssue (jiralib--rest-call-it (format "/rest/api/2/issue/%s" (first params)) :type "PUT" @@ -591,7 +602,6 @@ emacs-lisp" (apply 'vector (nreverse remote-field-values)))) - ;;;; Wrappers around JIRA methods (defun jiralib--rest-api-for-issue-key (key) diff --git a/elpa/org-jira-20240928.2340/org-jira-autoloads.el b/elpa/org-jira-20250802.302/org-jira-autoloads.el similarity index 100% rename from elpa/org-jira-20240928.2340/org-jira-autoloads.el rename to elpa/org-jira-20250802.302/org-jira-autoloads.el diff --git a/elpa/org-jira-20240928.2340/org-jira-pkg.el b/elpa/org-jira-20250802.302/org-jira-pkg.el similarity index 73% rename from elpa/org-jira-20240928.2340/org-jira-pkg.el rename to elpa/org-jira-20250802.302/org-jira-pkg.el index 1dd0f168..16dfc678 100644 --- a/elpa/org-jira-20240928.2340/org-jira-pkg.el +++ b/elpa/org-jira-20250802.302/org-jira-pkg.el @@ -1,12 +1,12 @@ ;; -*- no-byte-compile: t; lexical-binding: nil -*- -(define-package "org-jira" "20240928.2340" +(define-package "org-jira" "20250802.302" "Syncing between Jira and Org-mode." '((emacs "24.5") (cl-lib "0.5") (request "0.2.0") (dash "2.14.1")) :url "https://github.com/ahungry/org-jira" - :commit "5f591f5f4abd0ef12c64676e38d8ec3b13eba280" - :revdesc "5f591f5f4abd" + :commit "c7259fa13b8eb99a988b06cdaf3a04f9109904de" + :revdesc "c7259fa13b8e" :keywords '("ahungry" "jira" "org" "bug" "tracker") :maintainers '(("Matthew Carter" . "m@ahungry.com"))) diff --git a/elpa/org-jira-20240928.2340/org-jira-sdk.el b/elpa/org-jira-20250802.302/org-jira-sdk.el similarity index 98% rename from elpa/org-jira-20240928.2340/org-jira-sdk.el rename to elpa/org-jira-20250802.302/org-jira-sdk.el index 49032f50..455c8f8d 100644 --- a/elpa/org-jira-20240928.2340/org-jira-sdk.el +++ b/elpa/org-jira-20250802.302/org-jira-sdk.el @@ -101,6 +101,7 @@ (issue-id :type string :initarg :issue-id :documentation "The common ID/key, such as EX-1.") (issue-id-int :type string :initarg :issue-id-int :documentation "The internal Jira ID, such as 12345.") (filename :type (or null string) :initarg :filename :documentation "The filename to write issue to.") + (parent-key :type (or null string) :initarg :parent-key :documentation "The parent issue key if there is one") (priority :type (or null string) :initarg :priority) (proj-key :type string :initarg :proj-key) (reporter :type (or null string) :initarg :reporter) @@ -156,6 +157,7 @@ :id (path '(key)) :issue-id (path '(key)) :issue-id-int (path '(id)) + :parent-key (path '(fields parent key)) :priority (path '(fields priority name)) :proj-key (path '(fields project key)) :reporter (path '(fields reporter displayName)) ; reporter could be an object of its own slot values diff --git a/elpa/org-jira-20240928.2340/org-jira.el b/elpa/org-jira-20250802.302/org-jira.el similarity index 98% rename from elpa/org-jira-20240928.2340/org-jira.el rename to elpa/org-jira-20250802.302/org-jira.el index 6bb4a2a7..2f32f644 100644 --- a/elpa/org-jira-20240928.2340/org-jira.el +++ b/elpa/org-jira-20250802.302/org-jira.el @@ -9,8 +9,8 @@ ;; ;; Maintainer: Matthew Carter ;; URL: https://github.com/ahungry/org-jira -;; Package-Version: 20240928.2340 -;; Package-Revision: 5f591f5f4abd +;; Package-Version: 20250802.302 +;; Package-Revision: c7259fa13b8e ;; Keywords: ahungry jira org bug tracker ;; Package-Requires: ((emacs "24.5") (cl-lib "0.5") (request "0.2.0") (dash "2.14.1")) @@ -1117,7 +1117,7 @@ ORG-JIRA-PROJ-KEY-OVERRIDE being set before and after running." "Render single ISSUE." ;; (org-jira-log "Rendering issue from issue list") ;; (org-jira-log (org-jira-sdk-dump Issue)) - (with-slots (filename proj-key issue-id summary status priority headline id) Issue + (with-slots (filename proj-key issue-id summary status priority headline id parent-key) Issue (let (p) (with-current-buffer (org-jira--get-project-buffer Issue) (org-jira-freeze-ui @@ -1154,6 +1154,9 @@ ORG-JIRA-PROJ-KEY-OVERRIDE being set before and after running." (org-jira-entry-put (point) (symbol-name entry) val)))) '(filename reporter type type-id priority labels resolution status components created updated sprint)) + (when parent-key + (org-jira-entry-put (point) "parent-issue-key" (format "[jira:%s]" parent-key))) + (org-jira-entry-put (point) "ID" issue-id) (org-jira-entry-put (point) "CUSTOM_ID" issue-id) @@ -1811,31 +1814,32 @@ that should be bound to an issue." (defun org-jira-get-issue-struct (project type summary description &optional parent-id) "Create an issue struct for PROJECT, of TYPE, with SUMMARY and DESCRIPTION." - (if (or (equal project "") - (equal type "") - (equal summary "")) + (if (or (equal project "") (equal type "") (equal summary "")) (error "Must provide all information!")) (let* ((project-components (jiralib-get-components project)) (jira-users (org-jira-get-assignable-users project)) - (user (completing-read "Assignee: " (mapcar 'car jira-users))) + (user (completing-read "Assignee: " (mapcar #'car jira-users))) (priority (car (rassoc (org-jira-read-priority) (jiralib-get-priorities)))) (labels (org-jira-read-labels)) - (ticket-struct - `((fields - (project (key . ,project)) - (parent (key . ,parent-id)) - (issuetype (id . ,(car (rassoc type (if (and (boundp 'parent-id) parent-id) - (jiralib-get-subtask-types) - (jiralib-get-issue-types-by-project project)))))) - (summary . ,(format "%s%s" summary - (if (and (boundp 'parent-id) parent-id) - (format " (subtask of [jira:%s])" parent-id) - ""))) - (description . ,description) - (priority (id . ,priority)) - (labels . ,labels) - ;; accountId should be nil if Unassigned, not the key slot. - (assignee (accountId . ,(or (cdr (assoc user jira-users)) nil))))))) + (ticket-fields + `((project (key . ,project)) + (parent (key . ,parent-id)) + (issuetype (id . ,(car (rassoc type + (if (and (boundp 'parent-id) parent-id) + (jiralib-get-subtask-types) + (jiralib-get-issue-types-by-project project)))))) + (summary . ,(format "%s%s" summary + (if (and (boundp 'parent-id) parent-id) + (format " (subtask of [jira:%s])" parent-id) + ""))) + (description . ,description) + (priority (id . ,priority)) + (labels . ,labels) + (assignee (accountId . ,(cdr (assoc user jira-users)))))) + (filtered-fields (jiralib-filter-fields-by-exclude-list + jiralib-update-issue-fields-exclude-list + ticket-fields)) + (ticket-struct `((fields . ,filtered-fields)))) ticket-struct)) ;;;###autoload -- 2.47.3