Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Using the JIRA python module this example works:
from jira import JIRA jira = JIRA('https://jira.atlassian.com') issue = jira.issue('JRA-9') print(issue.fields.project.key) # 'JRA' print(issue.fields.issuetype.name) # 'New Feature' print(issue.fields.reporter.displayName) # 'Mike Cannon-Brookes [Atlassian]'
But I can get authentication working.
For example how do I query an issue named ISE-4 in a project name MYPROJECT
I tried authed_jira = JIRA(basic_auth=('myuser', 'mypass')) but this does not seem to work.
Does the hosted JIRA API support basic authentication?
EDIT: Standard basic authentication is now deprecated in Jira from June 2019.
An API key is required for basic authentication which now replaces the 'password' requirement. API key's can be generated from: https://confluence.atlassian.com/cloud/api-tokens-938839638.html.
You should use the following format:
jira = JIRA(
basic_auth=(un, pwd),
options={
'server': server
}
)
You need to pass in the server details as a connection option when you are specifying basic_auth.
in the example above, un pwd and server are all string variables.
When I try that I get a syntax error:
from jira import JIRA #jira = JIRA('https://jira.atlassian.com') jira = JIRA(basic_auth=('user', 'password123!'), options={'https://myaccount.atlassian.net'}) issue = jira.issue('blah-12') print(issue.fields.project.key) print(issue.fields.issuetype.name) print(issue.fields.reporter.displayName)
I Get this error:
ValueError: dictionary update sequence element #0 has length 29; 2 is required
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You haven't setup your dictionary correctly in the example above, you just specified the url as a key with no value, instead of a key/value pair.
Options should be:
options = {'server': 'https://myaccount.atlassian.net'}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This works ....
from jira import JIRA
def main():
options = {'server': jiraURL}
jira = JIRA(options, basic_auth=(jiraUserName, jiraPassword))
issue = jira.issue('ESS-138581')
print issue.fields.project.key
print issue.fields.issuetype.name
print issue.fields.reporter.displayName
print issue.fields.summary
print issue.fields.project.id
if __name__== "__main__" :
main()
If you get handshake error [SSLV3_ALERT_HANDSHAKE_FAILURE]. Kindly install the following modules in python
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
While trying above code @Harihar Pai I am getting below error:
WARNING:root:Got recoverable error from GET https://jira.company name/rest/api/2/serverInfo, will retry [1/3] in 6.687988879187072s. Err: 401
Can anyone explain to me why I am getting this error
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same here, on-premise jira is giving this error out of nowhere
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ruchit @Aibek Prenov When I was using this module with on prem JIRA, I could not use my real username to authenticate, but I had to use the JIRA assigned user key. In my organization, the key is of the form 'cc######'. I am not sure where you can determine your user key. For me, if I attempt to login to the web UI with my regular username, but the wrong password, when I am redirected back to the login page, my real username has been replaced with my user key.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi , When i use this code, I am getting SSL erro along wth No Certificate Error?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Standard basic authentication is now deprecated in Jira from June 2019.
An API key is required for basic authentication which now replaces the 'password' requirement. API key's can be generated from: https://confluence.atlassian.com/cloud/api-tokens-938839638.html.
Once the key has been obtained, replace your current Jira object with the following:
jira = JIRA(basic_auth=("enter username", "enter API key"), options={'server': "enter server"}).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Python | Step by Step how to access the hosted Jira API via python
[http://thepythoncoding.blogspot.com/2018/07/python-step-by-step-how-to-access.html]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you should use the following format:
jira = JIRA(basic_auth=(un, pwd), options={'server': server})
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
from jira import JIRA jira = jira = JIRA(basic_auth=(un, pwd), options={'server': server})
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.