From 3d505ff33ded34673120f11192a8dea836050e34 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Sat, 9 Apr 2022 00:55:48 -0400 Subject: [PATCH] Patch ejira-core to refer to users via accountId There must be some changes to, but user mentions require using "accountId" field from whatever data we receive from API listing all users. Also, assigning issues no longer works by full name, complaining about GDPR, so I had to pass accountId to jiralib2-assign-issue function, and redefine it to use it as following: (defun jiralib2-assign-issue (issue-key account) "Assign issue with ISSUE-KEY to USERNAME." (jiralib2-session-call (format "/rest/api/2/issue/%s/assignee" issue-key) :type "PUT" :data (json-encode `((accountId . ,account))))) --- ejira-core.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ejira-core.el b/ejira-core.el index 6b305f3..2bd2d45 100644 --- a/ejira-core.el +++ b/ejira-core.el @@ -805,7 +805,7 @@ With SHALLOW update only todo state." (mapcar (lambda (user) (let ((name (decode-coding-string (cdr (assoc 'displayName user)) 'utf-8)) - (key (cdr (assoc 'key user)))) + (key (cdr (assoc 'accountId user)))) (unless (s-starts-with? "#" key) (cons key name)))) (jiralib2-get-users (car ejira-projects)))))))) @@ -819,7 +819,7 @@ With SHALLOW update only todo state." (let* ((jira-users (ejira--get-users)) (fullname (completing-read "User: " (mapcar 'cdr jira-users))) (username (car (rassoc fullname jira-users)))) - (insert (format "[[jirauser:~%s]]" username)))) + (insert (format "[[~accountid:%s]]" username)))) (defun ejira--get-assignable-users (issue-key) "Fetch users that issue ISSUE-KEY can be assigned to." @@ -829,7 +829,7 @@ With SHALLOW update only todo state." (mapcar (lambda (user) (let ((name (decode-coding-string (cdr (assoc 'displayName user)) 'utf-8)) - (key (cdr (assoc 'name user)))) + (key (cdr (assoc 'accountId user)))) (unless (s-starts-with? "#" key) (cons key name)))) (jiralib2-get-assignable-users issue-key)))))