---
name: change-close
description: Close a ServiceNow change request with implementation notes and actual times. Use when the user wants to close, complete, or finish a change request after implementation.
user_invocable: true
---

# /change-close — Close Change Request

Close a change request in ServiceNow with implementation notes and actual start/end times.

## Steps

### 1. Get Change Details
Ask the user for the change request number if not provided. Then retrieve current details:
```bash
bash "${CLAUDE_PLUGIN_ROOT}/scripts/servicenow/get_change.sh" "CHANGE_NUMBER"
```

### 2. Validate Change State
Verify the change is in a state that allows closure (Implement or Review). If the change is already closed or cancelled, inform the user and stop.

### 3. Gather Closure Details
Ask the user for:
- **Close Code** (required): `successful`, `successful_with_issues`, `unsuccessful`, or `cancelled`
- **Close Notes** (required): Summary of what was implemented and any observations
- **Actual Start Time** (optional): When implementation actually started (YYYY-MM-DD HH:MM:SS)
- **Actual End Time** (optional): When implementation actually ended (YYYY-MM-DD HH:MM:SS)

### 4. Confirm Before Closing
Display a summary and ask for explicit confirmation:

```
Closing change request:
  Number:           [CHGxxxxxxx]
  Short Description: [description]
  Close Code:       [close_code]
  Close Notes:      [notes]
  Actual Start:     [start_time]
  Actual End:       [end_time]

Proceed? (yes/no)
```

**Do NOT proceed without explicit user confirmation.**

### 5. Update Change Record
Apply updates in sequence:
```bash
bash "${CLAUDE_PLUGIN_ROOT}/scripts/servicenow/update_change.sh" "SYS_ID" "close_code" "CLOSE_CODE"
```
```bash
bash "${CLAUDE_PLUGIN_ROOT}/scripts/servicenow/update_change.sh" "SYS_ID" "close_notes" "CLOSE_NOTES"
```
```bash
bash "${CLAUDE_PLUGIN_ROOT}/scripts/servicenow/update_change.sh" "SYS_ID" "state" "3"
```

### 6. Display Result
Confirm the change has been closed with:
- Change number
- Final state
- Close code and notes

### 7. Suggest Next Steps
- For emergency changes, remind the user that a post-implementation review is required
- Search for evidence documents to attach with `/onedrive-search`
- Review other open changes with `/change-list`

## Important
- **ALWAYS confirm with the user before closing a change**
- Close notes are mandatory — do not close without them
- For unsuccessful changes, recommend documenting lessons learned
- For emergency changes, flag that post-implementation review is required per ITIL
