feat: Add AutoEscalation — Elixir port of Opsbox::AutoEscalation#52
Open
Jez-A wants to merge 4 commits intoauto_escalation_adf_builderfrom
Open
feat: Add AutoEscalation — Elixir port of Opsbox::AutoEscalation#52Jez-A wants to merge 4 commits intoauto_escalation_adf_builderfrom
Jez-A wants to merge 4 commits intoauto_escalation_adf_builderfrom
Conversation
fdafb20 to
99ee28f
Compare
Jez-A
commented
Mar 3, 2026
| end | ||
|
|
||
| defp auto_escalation_enabled? do | ||
| Application.get_env(:zexbox, :auto_escalation_enabled, true) == true |
Author
There was a problem hiding this comment.
This environment variable will need to be added
2 tasks
1217069 to
846cb0b
Compare
0551ddc to
5d3d3e9
Compare
2 tasks
846cb0b to
698e096
Compare
Adds Zexbox.AutoEscalation, which handles automatic error-to-on-call
escalation via Jira. When an error is rescued, this module:
1. Generates a fingerprint (action::ErrorClass) and searches Jira for an
open ticket with that fingerprint (exact-match JQL, excludes resolved
statuses: Done / No Further Action / Ready for Support Approval).
2. If found: adds an ADF comment documenting the new occurrence.
3. If not found: creates a Bug ticket with ADF description, sets the
fingerprint and ZIGL Team custom fields, then transitions to "To do".
Returns {:ok, ticket_map}, {:error, reason}, or {:disabled, nil}.
Uses the SP project key in :production, SS otherwise.
Usage from a rescue block:
rescue
e ->
Zexbox.AutoEscalation.handle_error(
error: e,
stacktrace: __STACKTRACE__,
action: "checkout",
priority: "High",
zigl_team: "Purchase Ops"
)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…guments Mirrors the JiraClient refactor: handle_error/5, generate_fingerprint/2, and all private helpers now use explicit positional args instead of keyword lists. JiraClient call sites updated to match the new positional API. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5d3d3e9 to
3615fd1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR: #53 adds the Jira client used to search, create, add comments, and transition issues and tickets. Can be merged individually.
PR: #54 adds the ADFBuilder which builds Atlassian Document Format (ADF) maps for Jira issue descriptions and comments.
The planned merge order is 53, then 54, then 52 (this PR)
Usage
Impact
Allows us to connect critical-path exceptions and errors into our medic system seamlessly.
Test plan
mix test test/zexbox/auto_escalation_test.exs— 21 tests covering new-ticket path, existing-ticket path, disabled state, search failure fallback, and custom fingerprintsmix test— full suite green🤖 Generated with Claude Code