Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Get working again, by hardcoding library versions



If you are writing a script that interacts with Jira through a REST API, you should authenticate using an OAuth token, rather than an embedded username/password. Here we describe one way to do the 'oauth dance' to generate a trusted token using Python 3 - specifically the jirashell  utility from the jira Python package.  jirashell  then forms a useful basis for a Python script. Our example script uses OAuth to call an undocumented REST API for querying license data. Last updated  



Personal Access Tokens make this approach obsolete.  Use them instead if you are using Jira 8.14 and above.


These instructions no longer work for me on tested combinations {Ubuntu 18.04 + Python 3.6.9}, { Ubuntu 20.04 + Python 3.8.5}. The jirashell command should print a URL, but instead returns:

Code Block

Table of Contents

Establishing OAuth trust


Install Python libraries

Code Block
pip3 install -U pip   # upgrade pip to avoid "No module named 'setuptools_rust'" error
pip3 install jira ipython pyjwt 'jira[cli]==3.5.0' ipython==8.10 pyjwt

Yes, you need those particular versions. The jira  library >3.5.0 broke backwards-compat with older Jiras, and ipython > 8.10 is broken for our purposes.

titleModuleNotFoundError: No module named 'setuptools_rust'?

If you get an error:

Code Block
Collecting cryptography>=2.0 (from SecretStorage>=3.2; sys_platform == "linux"->keyring->jira)                                                                                                      
  Downloading (546kB)
    100% |████████████████████████████████| 552kB 2.8MB/s 
    Complete output from command python egg_info:
            =============================DEBUG ASSISTANCE==========================
            If you are seeing an error here please try the following to
            successfully install cryptography:
            Upgrade to the latest pip and try again. This will fix errors for most
            users. See:
            =============================DEBUG ASSISTANCE==========================
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-xs9c9nwd/cryptography/", line 14, in <module>
        from setuptools_rust import RustExtension 
    ModuleNotFoundError: No module named 'setuptools_rust'
Command "python egg_info" failed with error code 1 in /tmp/pip-build-xs9c9nwd/cryptography/

then pip3 install -U pip  should fix it.


Code Block
$ cp venv/bin/jirashell check-jira-license
$ vim check-jira-license   # Make changes
$ cat check-jira-license

# -*- coding: utf-8 -*-
import re
import sys

from jira.jirashell import get_config, JIRA

def main()if __name__ == '__main__':
    options, basic_auth, oauth, kerberos_auth = get_config()

    jira = JIRA(


if __name__ == '__main__': )

This command can then be invoked using the same command-line flags as jirashell :