~bkhl/ob-jira

Babel functions for Jira JQL evaulation
Fixed propagation of updated parameters
JQL body expansion fixes

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~bkhl/ob-jira
read/write
git@git.sr.ht:~bkhl/ob-jira

You can also use your local clone with git send-email.

ob-jira

ob-jira

Table of Contents

ob-jira provides Babel functions for Jira JQL evaluation.

It uses the JiraCLI program for communication with Jira.

1. Configuration

See JiraCLI page for instructions on how to install the program and configure it to authenticate to your Jira instance.

It should be sufficient to load the package to enable it, but the offical way to enable a language for Babel is like this:

(org-babel-do-load-languages 'org-babel-load-languages
                             '((emacs-lisp . t)
                               (jira . t)))

This would enable Babel for Emacs Lisp and JQL source code blocks.

2. Parameters

Corresponding JiraCLI command line flags are in parenthesis. Unless otherwise given, the default is whatever is the default for JiraCLI.

:config-file-path
--config: Alternative JiraCLI config file
:project
--project: Comma separated lists of Jira projects. If not project is given the whole query will be wrapped in project IS NOT EMPTY AND (…), since that is what you have to do with JiraCLI to query across all projects. If there are more than one, it will be wrapped in project IN (…) AND (…). In other words the --project command line flag will only be used if there is a single project given as the parameter.
:type :: --type: Type
(Bug, Task, &c.)
:resolution
--resolution
:status
--status
:priority
--priority
:reporter
--reporter
:assignee
--assignee
:component
--component
:label
--label: Comma separated labels
:parent
--parent
:history
--history
:watching
--watching
:created
--created
:updated
--updated
:created-after
--created-after
:updated-after
--updated-after
:created-before
--created-before
:updated-before
--updated-before
:columns
--columns
:order-by
--order-by: Comma separated list of fields to order by. (default: rank)
:order
--reverse: Order, either +/asc/ascending or -/desc/descending, defaults to ascending. The default amounts to using the --reverse commandline flag for JiraCLI. When using multiple keys to order by, the reversing only applies to the last key in the list.

3. Examples

Basic query with some parameters provided.

#+begin_src jql :columns key,summary :order ascending
assignee = currentUser() AND status != Closed
#+end_src

#+RESULTS:
#+begin_example
ABC-14392	Missing input validation
ABC-43891	Add calculator
#+end_example

Variables can be used as "functions" in the JQL.

#+NAME: xyz_tasks
#+begin_src jql :project XYZ :columns key,summary :order ascending :var user="bkhl"
assignee = user() AND status != Closed
#+end_src

#+RESULTS:
#+begin_example
XYZ-23035	Clicking play does nothing
XYZ-41894	Write user manual
#+end_example

This way, you can also reuse queries as using calls:

#+CALL: xyz_tasks(user="bob")

#+RESULTS:
#+begin_example
XYZ-41243	Prepare release party
#+end_example

4. Limitations

The JiraCLI tool does not support ORDER BY clauses so those are converted into --order-by and --reverse command line flags as needed. This means you can not use different ASC or DESC descriptions on individual keys in the sorting. You can add ASC or DESC at the end of the ORDER BY clause, but this will only affect the ordering of the final key.

5. TODOs

  • Support saving results as tables.