Skip to content

Commit

Permalink
jiralogin: workaround python jira bug
Browse files Browse the repository at this point in the history
Looks like its a bug in the jira python library.  An issue has been
created in Atlassian and in the python jira library.

Until its fixed upstream we add this workaround when authenticate in
JIRA.

Link: https://community.developer.atlassian.com/t/http-406-status-code-from-rest-api-3-resolution-search/75381/5
Link: pycontribs/jira#1774
Suggested-by: Julianus Larson <[email protected]>
Signed-off-by: Anders Roxell <[email protected]>
  • Loading branch information
roxell committed Dec 14, 2023
1 parent eb3fd7d commit cb56ddd
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions jipdate/jiralogin.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,31 @@ def get_jira_instance(use_test_server):
"Accessing %s with %s using token based authentication"
% (url, username)
)
j = JIRA(url, basic_auth=(username, token)), username
j = (
JIRA(
url,
basic_auth=(username, token),
options={
"headers": {"Accept": "application/json;1=1.0, */*;q=0.9"}
},
),
username,
)
else:
log.debug(
"Accessing %s with %s using password based authentication"
% (url, username)
)
j = JIRA(url, basic_auth=(username, password)), username
j = (
JIRA(
url,
basic_auth=(username, password),
options={
"headers": {"Accept": "application/json;1=1.0, */*;q=0.9"}
},
),
username,
)
except JIRAError as e:
if e.text.find("CAPTCHA_CHALLENGE") != -1:
log.error(
Expand Down

0 comments on commit cb56ddd

Please sign in to comment.