diff --git a/fixComponentLead.sh b/fixComponentLead.sh index cbb211e..d7dd1cf 100644 --- a/fixComponentLead.sh +++ b/fixComponentLead.sh @@ -58,9 +58,12 @@ fi # ----------------------------------------------------------------------------- # STEP E: Ask for the new user's **account ID** # ----------------------------------------------------------------------------- -# Because Cloud requires accountId to assign a lead, prompt for accountId -# (not a username). -read -p "Enter the new user's account ID: " new_account_id +read -p "Enter the new user's email address: " new_user_email +user_search_json=$(curl -s -G -u "$username:$api_token" \ + --data-urlencode "query=$new_user_email" \ + "$jira_base_url/rest/api/3/users/search") + +new_account_id=$(echo "$user_search_json" | jq -r '.[0].accountId') # Create a folder named after the old display name for history and logs mkdir -p "$old_display_name"