Skip to content

feat: Add Jira Service Management OAuth scope and CLI commands#51

Merged
fank merged 4 commits intomainfrom
claude/add-jsm-oauth-scope
Apr 17, 2026
Merged

feat: Add Jira Service Management OAuth scope and CLI commands#51
fank merged 4 commits intomainfrom
claude/add-jsm-oauth-scope

Conversation

@ktaganova
Copy link
Copy Markdown
Contributor

@ktaganova ktaganova commented Apr 17, 2026

Summary

  • Adds read:servicedesk-request OAuth scope to enable JSM API access
  • Adds atl sm command group for Jira Service Management:
    • atl sm service-desk list — list service desks
    • atl sm request-type list --service-desk-id <id> — list request types
    • atl sm request-type fields --service-desk-id <id> --request-type-id <id> — list fields for a request type
  • All commands support --json flag for structured output

Context

Discovered while debugging NX-15519 — needed to query request type fields via the JSM API to verify a fix, but the atl CLI lacked both the OAuth scope and any SM commands.

Test plan

  • Run atl auth login after updating — verify token includes read:servicedesk-request
  • Run atl sm service-desk list — verify service desks are listed
  • Run atl sm request-type list --service-desk-id 2 — verify request types listed
  • Run atl sm request-type fields --service-desk-id 2 --request-type-id 26 — verify fields listed
  • Run with --json flag — verify structured JSON output
  • Run go test ./... — all tests pass

Add read:servicedesk-request scope to enable API calls to the JSM
service desk endpoints (e.g. request types, fields). Without this
scope, any curl/API call to /rest/servicedeskapi/ returns 401.
@ktaganova ktaganova requested a review from fank April 17, 2026 08:40
@ktaganova ktaganova marked this pull request as ready for review April 17, 2026 08:40
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds the read:servicedesk-request scope to the default OAuth scopes for Jira Service Management. The reviewer suggests including read:servicedesk and write:servicedesk-request to facilitate service desk discovery and ensure consistency with other service permissions.

Comment thread internal/auth/oauth.go Outdated
Add 'atl sm' command group with:
- atl sm service-desk list — list service desks
- atl sm request-type list — list request types for a service desk
- atl sm request-type fields — list fields for a request type

Follows existing patterns: API service layer (api/sm.go), cobra
commands with --json support, table output for terminal use.

Note: Configuration uses map[string]interface{} to handle mixed-type
values (strings + booleans) that the Jira API returns, avoiding the
upstream go-atlassian bug that prompted this work (NX-15519).
@ktaganova ktaganova changed the title feat: Add Jira Service Management OAuth scope feat: Add Jira Service Management OAuth scope and CLI commands Apr 17, 2026
@github-actions
Copy link
Copy Markdown

Merging this branch will decrease overall coverage

Impacted Packages Coverage Δ 🤖
github.com/enthus-appdev/atl-cli/internal/api 36.48% (-0.30%) 👎
github.com/enthus-appdev/atl-cli/internal/auth 27.44% (ø)
github.com/enthus-appdev/atl-cli/internal/cmd 0.00% (ø)
github.com/enthus-appdev/atl-cli/internal/cmd/sm 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/enthus-appdev/atl-cli/internal/api/sm.go 11.76% (+11.76%) 17 (+17) 2 (+2) 15 (+15) 🎉
github.com/enthus-appdev/atl-cli/internal/auth/oauth.go 0.00% (ø) 79 0 79
github.com/enthus-appdev/atl-cli/internal/cmd/root.go 0.00% (ø) 47 (+1) 0 47 (+1)
github.com/enthus-appdev/atl-cli/internal/cmd/sm/requesttype.go 0.00% (ø) 66 (+66) 0 66 (+66)
github.com/enthus-appdev/atl-cli/internal/cmd/sm/servicedesk.go 0.00% (ø) 24 (+24) 0 24 (+24)
github.com/enthus-appdev/atl-cli/internal/cmd/sm/sm.go 0.00% (ø) 4 (+4) 0 4 (+4)

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/enthus-appdev/atl-cli/internal/api/sm_test.go

@fank fank merged commit 99e2f73 into main Apr 17, 2026
11 checks passed
@fank fank deleted the claude/add-jsm-oauth-scope branch April 17, 2026 09:09
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.

2 participants