Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how do i create login creds for python api

Marek Ptak _TT_
September 30, 2020

i tried using user email and api token .  that does not work.  using my regular web creds does not work

1 answer

0 votes
Roma Bubyakin _Wombats Corp_
Contributor
October 1, 2020

Hi @Marek Ptak _TT_ 

Could you please clarify is it Cloud (atlassian.net) or Server Jira?
In any way here is an example of python script that I'm using:

from jira import JIRA

# Variables block
baseUrl = 'http://localhost:8730'  # base url of your Jira instance
username = 'admin'        # username from Jira
token = 'QNuOzeGj3rfwdVFMUbIUx20Fuu0ZQ6u2lfe' # token (or password)

# Jira initialization block
options = {'server':baseUrl}
jira = JIRA(options, basic_auth=(username, token))

# Actual logic
issueKey = 'BVGB-10'
issue = jira.issue(issueKey)
print(issue.fields.summary)
Marek Ptak _TT_
October 1, 2020

so how do i go about creating this user and and token for local instance of jira ?

Roma Bubyakin _Wombats Corp_
Contributor
October 1, 2020

Regarding user, it's a username of user that you would like to use in automation.

It could be your personal username or dedicated user for such automation.

 

Regarding tokens, it's still not implemented for local instances.

You can use normal user' password there or give a try to my plugin API Tokens for Jira

I am a developer of that plugin, so feel free to ask any question regarding it

Marek Ptak _TT_
October 1, 2020

i am confused here.  i was given creds for web access they work.  i was told that same creds should work for python api.  they do not.  there is not facility on the web interface to create api token.  cloud jira has such option

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events