Hello community,
I am currently stuck with the following use case: my goal is to find user names within a directory as normally the display name is provided. If the input if wrong or cannot be found, the user should be able to loop until the entry is found. If the input has been found, the username should be returned and saved instead of the variable that has been provided initially.
Currently I am trying with "while TRUE" in combination with "try, expect, finally" but somehow this does not work properly. Can you help me find the tree in the forest?
I am currently stuck with the following use case: my goal is to find user names within a directory as normally the display name is provided. If the input if wrong or cannot be found, the user should be able to loop until the entry is found. If the input has been found, the username should be returned and saved instead of the variable that has been provided initially.
Currently I am trying with "while TRUE" in combination with "try, expect, finally" but somehow this does not work properly. Can you help me find the tree in the forest?
def searchUser(userstring): while True: try: userid = JIRA._get_user_id(userstring) except: userid = input("Please enter a valid user: ") else: return userid teamlead = "Teamleader_DisplayName" teamlead = searchUser(teamlead) departmentlead = "Departmentlead_DisplayName" departmentlead = searchUser(departmentlead)Where is my mental knot? Can you support me?