Skip to main content

Easily export JIRA issues to CSV

Project description

Jira-Select: Easily export issues from Jira to CSV

Quickstart

First, you need to configure jira-csv to connect to your jira instance:

jira-csv configure

Then, you'll need to create a yaml file describing your query and save it somewhere; example:

select:
  - key
  - summary
  - timetracking.originalEstimate as "Hours Estimate"
  - customfield_10048 as "My Important Field"
from: issues
where:
  - labels = "frontend"
  - assignee = "me@adamcoddington.net"
  - resolution is null

Now you can run your query:

jira-csv run /path/to/query.yaml

& it'll hand you back a CSV document with the fields you've selected.

See the built-in help (--help) for more options.

Advanced Usage

Functions

You can define and use functions for both formatting selected data and filtering rows returned from Jira.

Formatting rows

select:
  - status
  - summary
  - customfield_10069 as "Story Points"
  - array_len(customfield_10010) as "Sprint Count"
  - sprint_name(array_item(customfield_10010, -1)) as "Sprint Name"
from: issues

In the above example, two of the displayed columns are processed with a function:

  • Sprint Count: Will render the number of array elements in the field containing the list of sprints in which this issue was present.
  • Sprint Name: Will show the name of the last sprint associated with the displayed issue.

Omitting rows

select:
  - status as "Status"
  - summary as "Summary"
  - customfield_10069 as "Story Points"
from: issues
having:
  # The quoting below is required only because the first character of line
  # being a double-quote causes YAML parsers to parse the line differently
  - '"Sprint #19" in coalesce(sprint_name(array_item(customfield_10010, -1)), "")'

In the above example, the issues returned from Jira will be compared against each constraint you've entered in the having section; in this case, all returned issues not having the string "Sprint #19" in the name of the last sprint associated with the displayed issue will not be written to your output.

Note that having entries are processed locally instead of on the Jira server so filtering using having entries is much slower than using standard Jql due to the amount of (potentially) unnecessary data transfer involved. It is recommended that you use having only when your logic cannot be expressed in standard Jql (i.e. in the "where" section).

Limiting the number of results

You can limit the number of results returned by adding a limit to your query:

select:
  - key
  - status
  - summary
from: issues
where:
  - assignee = "me@adamcoddington.net"
limit: 10

Expanding Jira fields

You can ask Jira to expand issue fields by adding an expand element to your query:

select:
  - key
  - status
  - summary
from: issues
expand:
  - transitions

The meaning of these expansions is defined by Jira; you can find more information in Jira's documentation.

Grouping & Aggregation

You can group and/or aggregate your returned rows by using group_by:

select:
  - status
  - count(key)
from: issues
group_by:
  - status

You'll receive just a single result row for each status, and a count of how many records shared that status in the second column.

Ordering

You can order your entries using any expression, too:

select:
  - status
  - count(key)
from: issues
group_by:
  - status
order_by:
  - count(key) desc

This will order all tickets, grouped by status, in descending order from the status that has the most tickets to the one that has the fewest.

Future Goals

  • SQlite support: Instead of exporting a CSV, exporting an SQLite database.
  • XLSX support: Instead of exporting a CSV, exporing an XLSX document.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jira-select-1.1.0.dev26.tar.gz (19.6 kB view details)

Uploaded Source

Built Distribution

jira_select-1.1.0.dev26-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file jira-select-1.1.0.dev26.tar.gz.

File metadata

  • Download URL: jira-select-1.1.0.dev26.tar.gz
  • Upload date:
  • Size: 19.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2

File hashes

Hashes for jira-select-1.1.0.dev26.tar.gz
Algorithm Hash digest
SHA256 4473d7da0f817d85413e7c6a4bde12157edeb47376321e311902c2f226211892
MD5 fdcffd3bfb33359e4574d97fb5c59aa7
BLAKE2b-256 0ad221744e1f360f1c4bf56296b194b223fe1f1cefb915ba080c0107e22477f5

See more details on using hashes here.

File details

Details for the file jira_select-1.1.0.dev26-py3-none-any.whl.

File metadata

  • Download URL: jira_select-1.1.0.dev26-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2

File hashes

Hashes for jira_select-1.1.0.dev26-py3-none-any.whl
Algorithm Hash digest
SHA256 874f3d1bbad645f73cc0a7aee03071c24c64b7d14a031455b74299647014cfff
MD5 ae4367c069383d6d52fed3d3fefbb2a1
BLAKE2b-256 49b72989994a88a14c85cd48cfa750122c857be8a836e6a3b1afc4fe743a63c8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page