1

When I ran the portion of code below I get a JSON error message. I am trying to access a Jira project from Python but it keeps failing.

  File "C:\FAST\anaconda\python36\win64\431\Lib\json\decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 7 column 1 (char 6)

I have followed the examples provided by Python and Jira, but I cannot make the code work.

from jira.client import JIRA
import json
options = {
'server': 'https://some.server.net/jira12/projects/XXXX',
 }
USERNAME=input("Enter your username: ")
PASSWORD=input("Enter your password: ")
jira = JIRA(options, basic_auth=(USERNAME, PASSWORD))
issue = jira.issue('XXXX-260', expand='changelog')
jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Mario
  • 11
  • 2

2 Answers2

1

I happened to help a colleague solve a similar issue. I would suggest to try changing your server url from

options = {'server': 'https://some.server.net/jira12/projects/XXXX', }

to

options = {'server': 'https://some.server.net/', }
Shane Lu
  • 1,056
  • 1
  • 12
  • 21
0

I did it like this in a project:

JIRA(basic_auth=(self.username, self.password), options={'server': 'URL'})
sidi7
  • 393
  • 4
  • 11