Skip to content

feat(confluence): add get user by account ID tool#3345

Merged
waleedlatif1 merged 16 commits intostagingfrom
waleedlatif1/confluence-get-user
Feb 26, 2026
Merged

feat(confluence): add get user by account ID tool#3345
waleedlatif1 merged 16 commits intostagingfrom
waleedlatif1/confluence-get-user

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Add new confluence_get_user tool that retrieves a user's display name and profile info by their Atlassian account ID
  • Uses Confluence REST API v1 GET /wiki/rest/api/user?accountId={accountId} endpoint
  • Returns displayName, email, accountType, profilePicture, publicName
  • Wired into ConfluenceV2Block as "Get User" operation with accountId input field

Type of Change

  • New feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Feb 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Feb 26, 2026 1:06am

Request Review

@waleedlatif1 waleedlatif1 force-pushed the waleedlatif1/confluence-get-user branch from 44023d0 to 209550c Compare February 25, 2026 21:59
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 25, 2026

Greptile Summary

This PR successfully adds a new confluence_get_user tool that retrieves user profile information by Atlassian account ID. The implementation follows established patterns in the codebase and includes proper security measures.

Key Changes:

  • New tool definition in get_user.ts with proper OAuth configuration and response transformation
  • API route handler with comprehensive input validation using validatePathSegment for account IDs
  • Integration into ConfluenceV2Block with "Get User" operation and accountId input field
  • Updated OAuth scopes to include read:user:confluence and other necessary permissions
  • Complete documentation added for the new tool and related Confluence operations

Implementation Quality:

  • Security: Proper validation of account IDs using custom pattern /^[a-zA-Z0-9:-]+$/ matching Atlassian's format
  • Input sanitization with trim() and encodeURIComponent()
  • Consistent error handling and logging patterns
  • Follows existing architectural patterns for tool configuration and API routes

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation follows established patterns consistently, includes proper security validation, and integrates cleanly with existing OAuth and authentication systems. All necessary components (tool definition, API route, block configuration, registry, OAuth scopes, documentation) are properly implemented.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/tools/confluence/get_user.ts New tool configuration for fetching Confluence user by account ID - follows established patterns
apps/sim/app/api/tools/confluence/user/route.ts API route handler with proper authentication, input validation using validatePathSegment for account IDs
apps/sim/blocks/blocks/confluence.ts Added "Get User" operation to ConfluenceV2Block with accountId input field and proper output definitions
apps/sim/tools/registry.ts Registered confluence_get_user tool along with other new Confluence tools added in this PR
apps/sim/lib/auth/auth.ts Added read:user:confluence and other necessary OAuth scopes for new Confluence operations
apps/sim/lib/oauth/oauth.ts Updated Confluence OAuth provider configuration with required scopes for user, task, space, and blogpost operations

Last reviewed commit: ea45ee6

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

28 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@waleedlatif1
Copy link
Collaborator Author

@cursor review

@waleedlatif1
Copy link
Collaborator Author

@greptile

@waleedlatif1
Copy link
Collaborator Author

@cursor review

@waleedlatif1
Copy link
Collaborator Author

@greptile

waleedlatif1 and others added 6 commits February 25, 2026 16:22
…scendants, permissions, and properties

Add 16 new Confluence operations: list/get/update tasks, update/delete blog posts,
create/update/delete spaces, get page descendants, list space permissions,
list/create/delete space properties. Includes API routes, tool definitions,
block config wiring, OAuth scopes, and generated docs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The OAuth authorization flow uses scopes from auth.ts, not oauth.ts.
The 9 new scopes were only added to oauth.ts and the block config but
not to the actual provider config in auth.ts, causing re-auth to still
return tokens without the new scopes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove apostrophe from description that caused MDX generation to
truncate at the escape character.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Move get_user from GET to POST to avoid exposing access token in URL
- Add 400 validation for missing params in space-properties create/delete
- Add null check for blog post version before update to prevent TypeError

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
waleedlatif1 and others added 4 commits February 25, 2026 16:22
- Add type and depth fields to page descendants (from Confluence API)
- Add body field (storage format) to task list/get/update responses

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
validateAlphanumericId rejects valid Atlassian account IDs that contain
colons (e.g. 557058:6b9c9931-4693-49c1-8b3a-931f1af98134). Use
validatePathSegment with a custom pattern allowing colons instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@waleedlatif1 waleedlatif1 force-pushed the waleedlatif1/confluence-get-user branch from 671005b to ea45ee6 Compare February 26, 2026 00:22
@waleedlatif1
Copy link
Collaborator Author

@cursor review

@waleedlatif1
Copy link
Collaborator Author

@greptile

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

waleedlatif1 and others added 3 commits February 25, 2026 16:31
Return 400 when neither name nor description is provided for space
update, instead of sending an empty body to the Confluence API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
waleedlatif1 and others added 2 commits February 25, 2026 16:46
…list_tasks pagination

- Remove create_space from spaceId condition array since creating a space
  doesn't require a space ID input
- Remove list_tasks from generic supportsCursor array so it uses its
  dedicated handler that correctly passes assignedTo and status filters
  during pagination

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@waleedlatif1 waleedlatif1 merged commit fadbad4 into staging Feb 26, 2026
11 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/confluence-get-user branch February 26, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant