feat(incidents): Add skip-paging option for P0/P1 incidents#254
Conversation
Adds a "Skip paging on-call responders" checkbox to the /inc new modal that appears (and defaults to checked) when severity is P0 or P1. When selected, both PagerDuty paging and on-call channel invites are skipped. The flag is transient -- it threads from the Slack modal through serializer context to the incident hooks at creation time, with no model changes. The severity select now uses dispatch_action to dynamically show/hide the skip-paging option via views.update when the user changes severity. Closes RELENG-833 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Agent transcript: https://claudescope.sentry.dev/share/_VGnoulIKkldtN9n9qeKgA1BrEzRNdYIUxYb9B11C2o
The serializer test expected on_incident_created(incident) without the new skip_paging kwarg. The two new handler tests needed HOOKS_ENABLED=True to reach the on_incident_created call path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Agent transcript: https://claudescope.sentry.dev/share/uOhBQs8tSIs_BIgGrBMKGlxijRPYmS3xP0YXebZtObc
When a user changes severity in the modal, handle_severity_action now reads the current options_block selections from view state and threads them through to _build_options_block so initial_options reflects the user's prior choices (e.g. private) rather than resetting them. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Agent transcript: https://claudescope.sentry.dev/share/08Y9vY0PBATSmZuY5L6EAGyLKxFKk0sRIBUBbK-jk5U
When a user first selects P0/P1, skip_paging was not in the prior selections (it did not exist at the previous severity), so _build_options_block received an empty set and skipped the default-on branch. Now handle_severity_action injects skip_paging into the selected values when the new severity is high and skip_paging is not already present, ensuring it renders checked on first appearance. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Agent transcript: https://claudescope.sentry.dev/share/ADzF8zl8QmltQGscnYCK808rg5r0ERyZGJtS2FN9m4M
handle_severity_action now extracts user_id from the action body and passes it to _build_new_incident_modal so the captain block retains its initial_user when views.update rebuilds the modal. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Agent transcript: https://claudescope.sentry.dev/share/Qeq8_btcFr1qAGYpHcYenuDZuFQwAdU2EoYfA3V5dnI
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e6f1066. Configure here.
| if block.get("block_id") == "severity_block": | ||
| block["dispatch_action"] = True | ||
|
|
||
| blocks.append(_build_options_block(severity, selected_values=selected_options)) |
There was a problem hiding this comment.
Severity resets on view update
Medium Severity
After a user picks P0/P1, handle_severity_action rebuilds the modal via _build_new_incident_modal using the chosen severity only for the Options checkboxes. The severity static_select still comes from build_incident_form_blocks with its default P3 initial_option, so views.update can reset the dropdown while skip-paging options reflect the high severity—risking the wrong severity on submit or paging behavior that does not match what the user selected.
Reviewed by Cursor Bugbot for commit e6f1066. Configure here.
There was a problem hiding this comment.
False positive. Slack's views.update preserves user-selected state for elements whose block_id + action_id remain unchanged. The severity block keeps block_id="severity_block" and action_id="severity" across the update, so the user's selection is retained. The initial_option: P3 only applies when the field hasn't been interacted with yet.
— Claude Code
| initial_options: list[dict[str, Any]] = [] | ||
|
|
||
| is_high = severity in HIGH_SEVERITIES | ||
| if is_high: |
There was a problem hiding this comment.
so this will only show when high severity is selected? am I understanding that right?
There was a problem hiding this comment.
I'm quite sure the answer is yes after reading a bit more


Summary
/inc newSlack modal, grouped with the private incident toggle in a single Options blockviews.updateon severity change) and defaults to checkedAgent transcript: https://claudescope.sentry.dev/share/eReflyKHOjlxj3XHUR_WogKuafhwOofLe6_a9YdDSIA