Repository navigation
[Confluence] ConfluenceCloud: add get_user_details_by_accountid - #1716
Merged
gonchik merged 1 commit intoNov 4, 2026
Conversation
The Server client has get_user_details_by_accountid, but the Cloud client does not, so Confluence(url="https://<site>.atlassian.net") and ConfluenceCloud raise AttributeError for it. Add it to Cloud with the same arguments. It goes through get_user, so it requests GET /wiki/rest/api/user?accountId=... (plus expand when given), and maps 403 and 404 to ApiPermissionError and ApiNotFoundError like the Server method.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1716 +/- ##
=======================================
Coverage 65.47% 65.48%
=======================================
Files 107 107
Lines 19426 19436 +10
Branches 2127 2129 +2
=======================================
+ Hits 12720 12728 +8
- Misses 6000 6001 +1
- Partials 706 707 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The Server client has
get_user_details_by_accountid(accountid, expand=None), but the Cloud client (Confluence(url="https://<site>.atlassian.net")/ConfluenceCloud) doesn't, so the call fails with:This adds it to
Cloudwith the same arguments as the Server method. It callsget_user()(fixed in #1715), so it sends:with
expandadded when given. That'sgetUserin the Cloud v1 users reference, which takesaccountIdandexpand(operations,personalSpace). Like the Server method, a 403 raisesApiPermissionErrorand a 404 raisesApiNotFoundError.I didn't add
get_user_details_by_usernameorget_user_details_by_userkeyto Cloud, since Cloud no longer acceptsusernameorkeyon that endpoint.docs/confluence.rstdidn't listget_user_details_by_accountidyet, so I added it under "Users and Groups" with a note that the Cloud client has it too.Tests: added five
test_get_user_details_by_accountid*tests totests/confluence/test_confluence_cloud.py. They cover the request params, the final URL withexpand(https://test.atlassian.net/wiki/rest/api/user?expand=personalSpace&accountId=557058%3Af58131cb), the 403/404 errors, and a call throughConfluence(url="https://test.atlassian.net"). All five fail on master with the error above. The full pytest suite,tox -e mypy, bandit and doc8 pass, and black and flake8 are clean on the changed files. I haven't run it against a real Confluence Cloud site.