Adding new users by Python script

Maksim Zinchuk 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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 11, 2021

Hi! 

Please, wrap using try except to work with exception 

Suggest an answer

Log in or Sign up to answer