No description
Find a file
2025-06-03 14:26:08 +02:00
.github/workflows Fix event trigger 2021-08-12 17:03:33 +02:00
test Type-proof cr-stripping function 2021-08-12 21:10:15 +02:00
.gitignore Add ci & cask 2021-08-12 17:01:47 +02:00
Cask Add ci & cask 2021-08-12 17:01:47 +02:00
LICENSE Add license 2021-11-25 15:00:42 +01:00
Makefile Add ci & cask 2021-08-12 17:01:47 +02:00
README.org Update Readme 2021-11-25 14:51:21 +01:00
xjira.el Fix null guard on assignee 2025-06-03 14:26:08 +02:00

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:

  (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")))

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 here.

To set xjira-auth, use

  (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))))

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.