Repository navigation
fix: parse request types and send request type ids as strings - #84
Conversation
`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
There was a problem hiding this comment.
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.
Merging this branch will increase overall coverage
Coverage detailsCompared to commit 36a875e (run #38929816456)
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:
|
Summary
atl jira sm request-type listfailed for every service desk: the servicedeskapi returnsserviceDeskIdas a plain string, butRequestTypemodeled it as an object. The struct now matches the real response (serviceDeskId,portalId, andissueTypeIdas strings), and the table gains an "Issue Type ID" column.RequestTypestruct 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 forsd-customerrequesttypefields while atl reported the field as updated. Values of that type are now sent as strings.Test plan
go test ./...andgo vet ./...passsm request-type list --service-desk-id 1lists all 25 request types with their issue type ids, also with--jsonissue edit --field "Request Type=<id>"on a Service Desk ticket actually sets the request typeCloses #83