Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create User using Python-Jira

Tags:

python

jira

Looking into different methods to create users remotely. Does anyone have an example of this working, or know why this chunk of code isnt working?

import jira.client
from jira.client import JIRA

print('starting script')

options = {'server' : 'http://<server>.atlassian.net'}
jira = JIRA(options, basic_auth=('<username>', '<password>'))
jira.add_user('testUser1', '<emailaddress>', '12345', 'testUser1', False, True, False)

print('ending script')

Whenever I run this, I get a brick of error code that ends with "response text = {"errorMessages":["Either the 'username' or the 'key' query parameters need to be provided"],"errors":{}}"

Any help would be greatly appreciated!

like image 486
BlueBaroo Avatar asked Dec 11 '25 21:12

BlueBaroo


1 Answers

When setting options, I used http instead of https. This fixed my problem

like image 117
BlueBaroo Avatar answered Dec 14 '25 14:12

BlueBaroo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!