Skip to content

fix: parse request types and send request type ids as strings - #84

Merged
fjung merged 1 commit into
mainfrom
claude/sm-request-type-fixes
Nov 18, 2026
Merged

fjung merged 1 commit into
mainfrom
claude/sm-request-type-fixes

Conversation

@fjung

@fjung fjung commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • atl jira sm request-type list failed for every service desk: the servicedeskapi returns serviceDeskId as a plain string, but RequestType modeled it as an object. The struct now matches the real response (serviceDeskId, portalId, and issueTypeId as strings), and the table gains an "Issue Type ID" column.
  • The old test built its JSON from the RequestType struct itself, so it could not catch the mismatch. It now uses a payload shaped like the real API response.
  • issue edit --field "Request Type=3" sent the id as a number. Jira silently ignores that for sd-customerrequesttype fields while atl reported the field as updated. Values of that type are now sent as strings.

Test plan

  • go test ./... and go vet ./... pass
  • Unit tests: request types parse from a real-shaped payload; the table row includes the issue type id; request type values stay strings
  • Sandbox: sm request-type list --service-desk-id 1 lists all 25 request types with their issue type ids, also with --json
  • issue edit --field "Request Type=<id>" on a Service Desk ticket actually sets the request type
  • CI lint

Closes #83

`atl jira sm request-type list` failed for every service desk: the
servicedeskapi returns `serviceDeskId` as a plain string, but
`RequestType` modeled it as an object. The struct now matches the real
response, and the list shows each request type's issue type id. The
old test built its JSON from the struct itself, so it could not catch
the mismatch; it now uses a payload shaped like the real API.

`issue edit --field "Request Type=3"` sent the id as a number, which
Jira silently ignores for `sd-customerrequesttype` fields. Values of
that type are now sent as strings.

Closes #83

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

Copy link
Copy Markdown
Contributor

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 updates the RequestType struct to include IssueTypeID, ServiceDeskID, and PortalID fields, and exposes the 'Issue Type ID' in the command-line output. It also ensures that Service Management request type IDs are kept as strings to prevent Jira from silently ignoring them. Feedback on the changes suggests adding a nil check in requestTypeRows to avoid potential nil pointer dereferences when processing request types.

Comment thread internal/cmd/sm/requesttype.go Resolved
@github-actions

Copy link
Copy Markdown

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/enthus-appdev/atl-cli/internal/api 44.01% (ø)
github.com/enthus-appdev/atl-cli/internal/cmd/issue 11.78% (+0.12%) 👍
github.com/enthus-appdev/atl-cli/internal/cmd/sm 6.32% (+6.32%) 👍
Coverage details

Compared to commit 36a875e (run #38929816456)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/enthus-appdev/atl-cli/internal/api/sm.go 11.76% (ø) 17 2 15
github.com/enthus-appdev/atl-cli/internal/cmd/issue/field_util.go 69.05% (+0.75%) 84 (+2) 58 (+2) 26 👍
github.com/enthus-appdev/atl-cli/internal/cmd/sm/requesttype.go 8.96% (+8.96%) 67 (+1) 6 (+6) 61 (-5) 👍

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
  • github.com/enthus-appdev/atl-cli/internal/cmd/issue/field_util_test.go
  • github.com/enthus-appdev/atl-cli/internal/cmd/sm/requesttype_test.go

@fjung
fjung merged commit 2a3c29c into main Nov 18, 2026
11 checks passed
@fjung
fjung deleted the claude/sm-request-type-fixes branch November 18, 2026 14:22
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.

sm request-type list fails to parse the response (serviceDeskId is a string)

1 participant