fix: use accountId parameter for user lookups in Jira Cloud OAuth mode #581
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes an issue where
jira_get_user_profile
fails in Multi-Cloud OAuth mode when called with an email address. The API was incorrectly using theusername
parameter instead ofaccountId
for Jira Cloud instances.Fixes: #560, #580
Changes
JiraConfig.is_cloud
property to correctly identify Multi-Cloud OAuth as a Cloud instancecloud_id
now always returnTrue
foris_cloud
checkTesting
is_cloud
returnsTrue
for OAuth with cloud_idChecklist
Additional Context
In Multi-Cloud OAuth mode, the
JIRA_URL
environment variable may be None or empty, but the actual API URL used ishttps://api.atlassian.com/ex/jira/{cloud_id}
which is definitely a Cloud URL. The fix ensures that when OAuth is configured with a cloud_id, it's always treated as a Cloud instance, regardless of the configured URL.This resolves the issue where user lookups were failing with the error: "The 'accountId' query parameter needs to be provided" because the API was incorrectly using
username
parameter for email-based lookups on Jira Cloud.