https://github.com/adimit/xjira
A minimal scratch-your-own-itch Jira-integration for org-mode
https://github.com/adimit/xjira
Last synced: 5 months ago
JSON representation
A minimal scratch-your-own-itch Jira-integration for org-mode
- Host: GitHub
- URL: https://github.com/adimit/xjira
- Owner: adimit
- License: bsd-3-clause
- Created: 2021-08-07T11:04:49.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-08-05T11:32:21.000Z (11 months ago)
- Last Synced: 2025-09-24T21:48:56.818Z (9 months ago)
- Language: Emacs Lisp
- Size: 46.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
#+TITLE: XJIRA
A small Emacs package that allows you to define an entry in =org-capture-templates= that will fetch a Jira issue's information.
This is very much a scratch-my-own-itch package and provided as-is.
It depends on =let-alist= and Emacs ≥ 27.1, built with =libjansson=
support.
* Setup
Here's an example capture template:
#+begin_src emacs-lisp
(customize-set-variable
'org-capture-templates
`(("c" "Get Issue from Jira" entry)
(file+regexp your-org-file some-regexp)
,(string-join
'("* TODO %(xjira-org-capture-issue \"PROJECT\") %(xjira-get 'issue) %(xjira-get 'title)"
"SCHEDULED: %t"
":PROPERTIES:"
":REFERENCE: %(eval xjira-host)/browse/%(xjira-get 'issue)"
":Reporter: %(xjira-get 'reporter)"
":END:"
"%?"
"%(xjira-get 'description)")
"\n")))
#+end_src
=xjira-org-capture-issue= asks you for an issue number and then fetches the required information from Jira via REST. You can then use =xjira-get= to retrieve the contents of the issue.
Be sure to substitute =PROJECT= for your company's chosen cryptic Jira project shorthand. If you don't pass a string to =xjira-org-capture-issue=, you will be prompted for the project every time you capture something.
* Authentication
Jira supports basic auth using the =username:password= scheme. Jira
Cloud allows you to use the same basic auth, but you need to use a
token instead of your password. Token based auth will work with SAML
and 2FA enabled. Create a Jira Cloud token [[https://id.atlassian.com/manage-profile/security/api-tokens][here]].
To set =xjira-auth=, use
#+begin_src emacs-lisp
(let ((username "your-jira-username")
(password "your password or token"))
(custom-set-variables
'(xjira-auth (base64-encode-string (format "%s:%s" username password) 'no-line-break))))
#+end_src
Jira Cloud with SAML or 2FA will only work with tokens, not with
passwords. Be aware that base64 is just obfuscated plain text, so
everybody who has this string has your credentials.