I have been stuck on this for a few days. I have been able to connect to jira cloud on a jira I created using the following code:
from jira import JIRA
user = 'myemail'
apikey = 'myapikey'
server = 'https://xxxx.atlassian.net
options = {
'server': server
}
jira = JIRA(options, basic_auth=(user,apikey) )
ticket = 'ISSUENAME'
issue = jira.issue(ticket)
summary = issue.fields.summary
print('ticket: ', ticket, summary)
But when I try to replicate the same on my organization's jira, which seems to be hosted on a server as it has a server name of the form https://jira.orgname.org/, I keep running into error 401
<script type="text/javascript" src="/rest/api/1.0/shortcuts/820010/3dded95ccd77bfee0411e37033e135ca/shortcuts.js"></script>
<meta name="application-name" content="JIRA" data-name="jira" data-version="8.20.10">
</head>
<body id="jira" class="aui-layout aui-style-default page-type-message " data-version="8.20.10" >
<!-- HTTPError401 -->
<div class="aui-page-panel" ><div class="aui-page-panel-inner">
<main role="main" id="main" class="aui-page-panel-content" >
<div class="aui-page-header" ><div class="aui-page-header-inner">
<div class="aui-page-header-main" >
<h1>Unauthorized (401)</h1>
</div>
</div></div>
<div class="aui-message aui-message-warning warning">
<p>Encountered a <code>"401 - Unauthorized"</code> error while loading this page.</p>
<p>Basic Authentication Failure - Reason : AUTHENTICATED_FAILED</p>
<p><a href="/secure/MyJiraHome.jspa">Go to Jira home</a></p>
</div>
</main>
</div></div>
</body>
</html>
I have tried to use my password instead of my apikey, I have also tried to use a PAT. All seem to give me the same result.