Is there a way by which I can know which user source the project is using.
This is to add user using script to the user source which the project is currently set to.
If there is any change of user source then user should be added to that user source.
i.e. system.user.addUser("AcmeWest", userToGet)
I want a variable to be used instead of “AcmeWest”
String userSource - The user source to add a user to. If set to an empty string, the function will attempt to use the project’s default user source (if called from a project).
you also have to provide an empty string in the getNewUser()
this worked for me
userToGet = system.user.getNewUser("", "mTrejo")
# Add some contact info.
contactInfo = {"email":"mTrejo@acmewest.com","sms": "5551234"}
userToGet.addContactInfo(contactInfo)
userToGet.set("password", "thisIsMyPassword")
# Adds a user to the the AcmeWest usersource.
system.user.addUser("", userToGet)
Also system.user.getUsers() does not take null string as an argument
Hence, I'm not able to iterate through all the users in the usersource and check if there already exits an user with same Email ID that I'm about to add.