Login to JIRA with Python

Pranay Verma September 24, 2019

Hi,

I've a python script that I'm using for an automated backlog update process.

For this I've written this as the first few lines:

jira_options = {'server' : 'http://server-name'}

jira = JIRA(options = jira_options, basic_auth = ('username', 'password'))

Is there any way I could not explicitly store the password in the code??

1 answer

1 vote
Michael Wohlgemuth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 24, 2019

Hey @Pranay Verma ,

chances are i misunderstood the question, but here goes:

Is there any way I could not explicitly store the password in the code??

Yeah. Store it in a file and protect the file via permissions, or hand the password to the script via command line arguments.

Ill give you two entry points to google them:

  • python argparse
  • python configparser

regards

Pranay Verma September 27, 2019

Hi @Michael Wohlgemuth ,

I used oAuth rather than using BasicAuth, and that essentially solves the issue. Also, your suggestion regarding protecting the file also makes sense, thanks!!

Thanks,

Pranay.

Like Michael Wohlgemuth likes this

Suggest an answer

Log in or Sign up to answer