From 3a6ecd895732387f0fec1ba0497ba4bff5a23c52 Mon Sep 17 00:00:00 2001 From: Anders Roxell Date: Thu, 14 Dec 2023 10:00:58 +0100 Subject: [PATCH] jiralogin: workaround python jira bug 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: https://github.com/pycontribs/jira/issues/1774 Suggested-by: Julianus Larson Signed-off-by: Anders Roxell --- jipdate/jiralogin.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/jipdate/jiralogin.py b/jipdate/jiralogin.py index d6647e3..53fbb58 100644 --- a/jipdate/jiralogin.py +++ b/jipdate/jiralogin.py @@ -110,7 +110,16 @@ 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"