From 6be1bc053929662e6e34c1c50d5a01487736f573 Mon Sep 17 00:00:00 2001 From: Cody Cook Date: Wed, 22 Jan 2025 13:00:19 -0800 Subject: [PATCH] Fix the lookup of email ID --- fixComponentLead.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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"