fix(jtk): strip server-assigned fields and parse ruleUuid in auto create#109
fix(jtk): strip server-assigned fields and parse ruleUuid in auto create#109
Conversation
Fixes two bugs in the automation create command: 1. Exported rule JSON containing uuid, id, ruleKey, created, and updated fields is now stripped before sending to the API, preventing "UUID already exists" errors during export-then-create workflows. 2. The response parser now handles the ruleUuid field returned by Jira Cloud, fixing the empty identifier in the success message. Closes #104
TDD Assessment: PR #109SummaryThis PR fixes two bugs in What's CoveredBug 1 -- Field stripping (
Bug 2 --
Identifier precedence (
Error paths (unchanged but still passing):
What's Not Covered (and Whether It Matters)
VerdictTests are well-written and sufficient for this PR. The two bugs are directly and thoroughly tested. The field-stripping test is particularly strong -- it checks both that unwanted fields are removed and that wanted fields survive, which guards against over-stripping regressions. The The uncovered lines fall into two categories: (a) unreachable defensive branches that cannot be triggered without corrupting Go's JSON library, and (b) pre-existing fallback paths that were not changed in this PR. None of these represent meaningful risk for the changes being introduced. Coverage of |
Summary
uuid,id,ruleKey,created,updatedfrom exported rule JSON before POSTing to the Automation API, preventing "UUID already exists" rejectionruleUuidto the create response parser so the success message shows the correct identifierCloses #104
Test plan
ruleUuidfield shows correct UUIDuuidandruleUuidprefersuuid