[bug] closeTicket sends resolution field even when the target transition has no resolution screen #9
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found during end-to-end testing of #8.
POST /api/wxccai/ticket/:key/closealways sendsresolution: 'Done'(or the caller-supplied value) as part of the transition payload, even when the target transition doesn't have a Resolution field on its screen. This causes Jira to return:Repro (against a JSM ticket in a non-done state):
Yields HTTP 400 even though
resolution: nullwas explicitly passed. The route/service is still including the field in the transition payload.Suggested fix in
src/services/jira/issues.js#closeTicket/transitionTicket:resolutionisnull/undefined/ empty string, drop it from the payload entirely (don't sendresolution: null)."Done"when the target transition'sto.statusCategory === "done"(introspect viagetTransitions()output already available).POST /api/wxccai/ticket/:key/transitionendpoint that skips the resolution logic entirely, for callers that want to transition without closing.Workaround in the meantime: use the direct REST API (
POST /rest/api/3/issue/{key}/transitionswith just{ transition: { id: '<id>' } }) for non-done transitions.Low priority — doesn't block anything; the 'done' close path still works when the workflow validators are satisfied. Nice-to-have for admin/cleanup tooling.
Fixed as part of the ticket-closure feature in commit
034e657on branchcursor/close-tickets(see also #10).closeTicketnow inspects the target transition's status category and only sends theresolutionfield when the target isdone. Non-done transitions (e.g. "Waiting for customer") no longer 400 withField 'resolution' cannot be set. It is not on the appropriate screen, or unknown.The route handler in
wxccRoutes.jsalso stopped hard-defaultingresolutionto'Done'— that default is now applied deep insidecloseTicketonly when appropriate.Verified via the SS-20948 close in #10 which exercises the same code path.