Repository navigation
[Confluence] ConfluenceCloud: fix get_user - #1715
Merged
gonchik merged 1 commit intoOct 31, 2026
Merged
Conversation
Cloud.get_user requests /wiki/rest/api/user/{user_id}, but the v1 user
API has no such endpoint, so the call always fails with a 404. Users
are looked up with GET /wiki/rest/api/user?accountId=..., the same
endpoint and query parameter the Server get_user_details_by_accountid
uses.
Send the account ID as the accountId query parameter instead. Extra
params passed by the caller are kept.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1715 +/- ##
=======================================
Coverage 65.47% 65.47%
=======================================
Files 107 107
Lines 19425 19426 +1
Branches 2127 2127
=======================================
+ Hits 12719 12720 +1
Misses 6000 6000
Partials 706 706 ☔ 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.
ConfluenceCloud.get_user(user_id)(andConfluence(url="https://<site>.atlassian.net").get_user(...)) sends:The Confluence Cloud v1 REST API doesn't have that endpoint. A user is fetched with
GET /wiki/rest/api/user?accountId={accountId}(getUserin the users reference and the v1 OpenAPI spec). The only paths under/user/{userId}are the user property endpoints, so the call always fails with a 404.This changes
get_userto:GET /wiki/rest/api/userwith the account ID in theaccountIdquery parameter, the same endpoint and parameter the Serverget_user_details_by_accountid()uses;paramspassed by the caller (for exampleexpand) and addaccountIdto them.The argument name and the return value are unchanged.
Tests: updated
test_get_userintests/confluence/test_confluence_cloud.py(it asserted the/user/{id}path) and added two tests, one for extra params and one that checks the final URL ishttps://test.atlassian.net/wiki/rest/api/user?accountId=557058%3Af58131cb. The three tests fail on master. 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.