| .github/workflows | ||
| test | ||
| .gitignore | ||
| Cask | ||
| LICENSE | ||
| Makefile | ||
| README.org | ||
| xjira.el | ||
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.