Skip to content

fix(jira): add missing write:attachment:jira oauth scope#3541

Merged
waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1/jira-scope-fix
Mar 12, 2026
Merged

fix(jira): add missing write:attachment:jira oauth scope#3541
waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1/jira-scope-fix

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Add missing write:attachment:jira granular scope needed by jira_add_attachment tool

Type of Change

  • Bug fix

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 Mar 12, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Mar 12, 2026 7:13pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 12, 2026

Greptile Summary

This PR is a minimal, targeted bug fix that adds the missing write:attachment:jira granular OAuth scope required by the jira_add_attachment tool. Without this scope, the Jira OAuth token would lack the necessary permission to upload attachments to issues via the Atlassian REST API.

Changes made:

  • apps/sim/lib/oauth/oauth.ts: Adds 'write:attachment:jira' to the Jira provider's granular scopes list, placed correctly between read:attachment:jira and delete:attachment:jira.
  • apps/sim/lib/oauth/utils.ts: Adds the corresponding human-readable description 'Add attachments to Jira issues' to SCOPE_DESCRIPTIONS, keeping it consistent with all other scope descriptions in the file.

Confidence Score: 5/5

  • This PR is safe to merge — it's a minimal, additive-only fix with no risk of regression.
  • The change adds exactly one missing OAuth scope (write:attachment:jira) and its description — no existing logic is modified, and the placement follows the established read/write/delete ordering pattern used throughout the file. The fix directly matches the Atlassian API requirement for uploading attachments.
  • No files require special attention.

Important Files Changed

Filename Overview
apps/sim/lib/oauth/oauth.ts Adds write:attachment:jira granular OAuth scope in the correct position (between read:attachment:jira and delete:attachment:jira), consistent with the read/write/delete pattern used for all other Jira resources.
apps/sim/lib/oauth/utils.ts Adds the corresponding SCOPE_DESCRIPTIONS entry for the new write:attachment:jira scope with an accurate description, maintaining alphabetical/logical ordering alongside related attachment scopes.

Sequence Diagram

sequenceDiagram
    participant User
    participant SimApp
    participant JiraOAuth as Jira OAuth
    participant JiraAPI as Jira API

    User->>SimApp: Trigger jira_add_attachment tool
    SimApp->>JiraOAuth: Request token with scopes (including write:attachment:jira)
    JiraOAuth-->>SimApp: Access token granted
    SimApp->>JiraAPI: POST /rest/api/3/issue/{issueKey}/attachments
    Note over SimApp,JiraAPI: Requires write:attachment:jira scope
    JiraAPI-->>SimApp: Attachment metadata
    SimApp-->>User: Return attachment result
Loading

Last reviewed commit: 235ac38

@waleedlatif1 waleedlatif1 force-pushed the waleedlatif1/jira-scope-fix branch from 235ac38 to 2fd4c4e Compare March 12, 2026 19:13
@cursor
Copy link

cursor bot commented Mar 12, 2026

PR Summary

Low Risk
Low code risk (adds a single scope string), but it changes Jira OAuth permissions and may require users to re-authorize to grant attachment upload access.

Overview
Adds the missing Jira granular OAuth permission write:attachment:jira to the Jira service’s requested scopes in oauth.ts so attachment uploads can be authorized.

Updates SCOPE_DESCRIPTIONS in utils.ts to include a human-readable label for the new scope so it displays correctly in scope/permission prompts.

Written by Cursor Bugbot for commit 2fd4c4e. Configure here.

@waleedlatif1 waleedlatif1 merged commit 75832ca into staging Mar 12, 2026
7 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/jira-scope-fix branch March 12, 2026 19:14
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