From 65b05090fedd7b51cfa606667289b36822301b8f Mon Sep 17 00:00:00 2001 From: toharris-rh Date: Tue, 16 Jun 2026 15:44:47 -0700 Subject: [PATCH] fix: add close_code and close_notes when resolving SNow incident ServiceNow data policy requires both fields when setting state to Resolved (6). Omitted for non-success outcomes so the failure path is unaffected. Closes #135 Co-Authored-By: Claude Sonnet 4.6 (1M context) --- CHANGELOG.md | 8 ++++++++ playbooks/servicenow/update_incident.yml | 2 ++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e265edb..3f11adc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## [Unreleased] +### Fixed (2026-06-16) + +- **SNow close incident — add `close_code` and `close_notes`** — resolving a + ServiceNow incident (state 6) requires both fields per the instance's data + policy. Added `close_code: "Solved (Permanently)"` and `close_notes` (same + content as the work note) to the PATCH payload in `update_incident.yml` when + `inc_outcome == success`. Non-success paths are unaffected. Closes #135. + ### Removed (2026-06-16) - **EDA self-POST play removed from `introduce_cve.yml`** — the second play that diff --git a/playbooks/servicenow/update_incident.yml b/playbooks/servicenow/update_incident.yml index ec4b23f..276ac98 100644 --- a/playbooks/servicenow/update_incident.yml +++ b/playbooks/servicenow/update_incident.yml @@ -105,6 +105,8 @@ data: state: "{{ _state_map[inc_outcome] }}" work_notes: "{{ _comment_map[inc_outcome] }}" + close_code: "{{ 'Solved (Permanently)' if inc_outcome == 'success' else omit }}" + close_notes: "{{ _comment_map[inc_outcome] if inc_outcome == 'success' else omit }}" - name: Show update result ansible.builtin.debug: