A Python library to convert Jira issues to Json.
The library is based on the Jira REST API, and uses the Requests library.
It contacts the Jira server, downloads the issues according to the specified JQL query, and converts them to Json. An API is provided to access the issues and their fields and for further processing.
Supports Jira Datacenter.
Install the library with pip:
pip install "jira2json[dotenv]"
The dotenv
extra installs the python-dotenv
library, which is used to load the Jira server's url and the authentication token
from a .env
file.
The library can be used as a command line tool or as a Python library.
The command line tool is called jira2json
and is installed with the library.
Run jira2json --help
for usage information.
The library exports the following functions:
iterate_jira_issues
: iterates over the issues returned by a JQL query.prase_issues
: applies parsers on the issue's data.save_jsons_to_file
: saves the issues to a file.
Typical usage:
from jira2json import iterate_jira_issues, prase_issues, save_jsons_to_file
# Iterate over the issues returned by the JQL query
issues = iterate_jira_issues(
base_url='https://jira.atlassian.com',
jql='project=JRA',
token='mytoken',
)
# Parse the jsons and convert them to a more usable format
issues = prase_issues(issues)
# Save the issues to a file
with open('issues.json', 'w') as f:
save_jsons_to_file(issues, f)
Install the dev
extra:
pip install -e .[dev,dotenv]