Forums

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

Adding new users by Python script

Maksim Zinchuk
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 16, 2019

Hi! Trying to add new users by python script from txt file, which looks like:

"jack black, email@gmail.com

alex white, 123@yahoo.com"

Script looks like:

"with open('users.txt') as file:

for line in file.readlines():

name, email, work = line.split(",")

print(name, email)

#jira.add_user(name,email)"

But it doesnot work as intended. Only 1 user can be added, after that exception message with error 500. And user in Jira looks like

"email email

email@gmail.com"

 

Whay i should do to make all users be added without this problems?

 

1 answer

0 votes
Gonchik Tsymzhitov
Community Champion
February 11, 2021

Hi! 

Please, wrap using try except to work with exception 

Suggest an answer

Log in or Sign up to answer